File: issue0453.feature

package info (click to toggle)
behave 1.2.6-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,160 kB
  • sloc: python: 19,857; makefile: 137; sh: 18
file content (42 lines) | stat: -rw-r--r-- 1,412 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@issue
@unicode
Feature: Issue #453 -- Unicode output problem when Exception is raised in step

  . Either Exception text (as summary) or traceback python line shows
  . special characters incorrectly.
  .
  . Result (of failed step):
  .     File "features/steps/steps.py", line 8, in foo
  .        raise Exception(u"по ����ки") <-- This is not
  .   Exception: по русски <-- This is OK


    Scenario:
      Given a new working directory
      And a file named "features/steps/problematic_steps.py" with:
        """
        # -*- coding: UTF-8 -*-
        from behave import step

        @step(u'an exception with special chars is raised')
        def step_exception_raised(context):
            raise Exception(u"по русски")
        """
      And a file named "features/syndrome.feature" with:
        """
        Feature:
          Scenario:
            Given an exception with special chars is raised
        """
      When I run "behave -f plain features/syndrome.feature"
      Then it should fail with:
        """
        Scenario:
          Given an exception with special chars is raised ... failed
        """
      And the command output should contain:
        """
          File "features/steps/problematic_steps.py", line 6, in step_exception_raised
            raise Exception(u"по русски")
        Exception: по русски
        """