diff --git a/allure-behave/features/steps/dummy_steps.py b/allure-behave/features/steps/dummy_steps.py index 24cacf25..03084808 100644 --- a/allure-behave/features/steps/dummy_steps.py +++ b/allure-behave/features/steps/dummy_steps.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + import allure from behave import given @@ -26,3 +28,9 @@ def step_impl(*args, **kwargs): @given(u'{what} broken step {where}') def step_impl(*args, **kwargs): raise ZeroDivisionError() + + +@given(u'всегда будет <это>') +@given(u'всегда буду я') +def step_impl(*args, **kwargs): + pass diff --git a/allure-behave/features/unicode.feature b/allure-behave/features/unicode.feature index 249a97ed..b1ff64a5 100644 --- a/allure-behave/features/unicode.feature +++ b/allure-behave/features/unicode.feature @@ -2,10 +2,20 @@ Feature: Language Scenario: Use russian Given feature definition ru """ - Функционал: Язык + Функционал: Юникод - Сценарий: На русском - Допустим passed step + Структура сценария: Солнечный круг, небо вокруг + Пусть всегда будет <это> + Пусть всегда буду я + Примеры: + | это | + | солнце | + | небо | + | мама | """ When I run behave with allure formatter with options "--lang ru" - Then allure report has a scenario with name "На русском" \ No newline at end of file + Then allure report has a scenario with name "Солнечный круг, небо вокруг" + And scenario contains step "Пусть всегда будет солнце" + And scenario contains step "Пусть всегда будет небо" + And scenario contains step "Пусть всегда будет мама" + And scenario contains step "Пусть всегда буду я" \ No newline at end of file diff --git a/allure-behave/src/utils.py b/allure-behave/src/utils.py index 0c6e1e7b..5af37250 100644 --- a/allure-behave/src/utils.py +++ b/allure-behave/src/utils.py @@ -4,6 +4,7 @@ from allure_commons.model2 import Status, Parameter, Label from allure_commons.model2 import StatusDetails from allure_commons.utils import md5 +from allure_commons.utils import represent import traceback STATUS = { @@ -82,7 +83,7 @@ def step_status(result): def step_status_details(result): if result.exception: - message = u','.join(map(str, result.exception.args)) + message = u','.join(map(represent, result.exception.args)) message = u'{name}: {message}'.format(name=result.exception.__class__.__name__, message=message) trace = u'\n'.join(traceback.format_tb(result.exc_traceback)) if result.exc_traceback else None return StatusDetails(message=message, trace=trace)