Commit 4a69e5d0 by Petar Shomov

unicode characters in the step names do not cause xunit plugin to break

parent b510787b
Feature: Unicode characters in the error traceback
Scenario: It should pass
Given my dæmi that passes
Scenario: It should raise an exception different of AssertionError
Given my "dæmi" that blows an exception
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'my dæmi that passes')
def given_my_daemi_that_passes(step, d):
step.given(u'my "INNSKRÁ" that blows a exception')
@step('my "(.*)" that blows an exception')
def given_my_daemi_that_blows_a_exception(step, name):
assert False
...@@ -104,4 +104,20 @@ def test_xunit_output_with_different_filename(): ...@@ -104,4 +104,20 @@ def test_xunit_output_with_different_filename():
assert_equals(1, len(called), "Function not called") assert_equals(1, len(called), "Function not called")
xunit_output.wrt_output = old xunit_output.wrt_output = old
@with_setup(prepare_stdout, registry.clear)
def test_xunit_output_with_unicode_characters_in_error_messages():
called = []
def assert_correct_xml(filename, content):
called.append(True)
assert_xsd_valid(filename, content)
old = xunit_output.wrt_output
xunit_output.wrt_output = assert_correct_xml
runner = Runner(feature_name('unicode_traceback'), enable_xunit=True,
xunit_filename="custom_filename.xml")
runner.run()
assert_equals(1, len(called), "Function not called")
xunit_output.wrt_output = old
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment