From d297b12249be88386a3ee4f8ad1993d7f46e1a53 Mon Sep 17 00:00:00 2001 From: Stas Seliverstov Date: Sat, 5 Aug 2017 04:42:46 +0300 Subject: [PATCH 1/2] avoid behave bug --- allure-behave/features/steps/behave_steps.py | 9 +-------- allure-behave/features/unicode.feature | 1 - allure-behave/src/utils.py | 2 +- allure-behave/tox.ini | 2 +- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/allure-behave/features/steps/behave_steps.py b/allure-behave/features/steps/behave_steps.py index d3b19006..4c9e3e66 100644 --- a/allure-behave/features/steps/behave_steps.py +++ b/allure-behave/features/steps/behave_steps.py @@ -23,18 +23,11 @@ def hooks_implementations(context): exec(context.text, context.globals) -# ToDo FixMe -@then(u'skip for python 2') -def crack_the_world(context): - if sys.version_info.major < 3: - exit(0) - - @when(u'I run behave with allure formatter') @when(u'I run behave with allure formatter with options "{args}"') def run_behave_with_allure(context, **kwargs): def run(context, **kwargs): - cmd_args = '-v -f allure_behave.formatter:AllureFormatter -f pretty' + cmd_args = '--capture-stderr -f allure_behave.formatter:AllureFormatter' cmd = '{options} {cmd}'.format(cmd=cmd_args, options=kwargs.get('args', '')) config = Configuration(command_args=cmd) diff --git a/allure-behave/features/unicode.feature b/allure-behave/features/unicode.feature index f4f7f2ef..b1ff64a5 100644 --- a/allure-behave/features/unicode.feature +++ b/allure-behave/features/unicode.feature @@ -13,7 +13,6 @@ Feature: Language | небо | | мама | """ - Then skip for python 2 When I run behave with allure formatter with options "--lang ru" Then allure report has a scenario with name "Солнечный круг, небо вокруг" And scenario contains step "Пусть всегда будет солнце" diff --git a/allure-behave/src/utils.py b/allure-behave/src/utils.py index 176ac9f0..1b3d5140 100644 --- a/allure-behave/src/utils.py +++ b/allure-behave/src/utils.py @@ -28,7 +28,7 @@ def scenario_history_id(scenario): parts = [scenario.feature.name, scenario.name] if scenario._row: row = scenario._row - parts.extend(['{name}={value}'.format(name=name, value=value) for name, value in zip(row.headings, row.cells)]) + parts.extend([u'{name}={value}'.format(name=name, value=value) for name, value in zip(row.headings, row.cells)]) return md5(*parts) diff --git a/allure-behave/tox.ini b/allure-behave/tox.ini index 8b705240..35636ced 100644 --- a/allure-behave/tox.ini +++ b/allure-behave/tox.ini @@ -21,7 +21,7 @@ deps= commands= python setup.py develop rm -rf {envtmpdir}/* - behave -f allure_behave.formatter:AllureFormatter -o {envtmpdir}/allrue-result -f pretty {posargs: ./features} + behave --no-capture -f allure_behave.formatter:AllureFormatter -o {envtmpdir}/allrue-result -f pretty {posargs: ./features} [testenv:demo] From 004b04830e0c33579f3575b6b5aa64d75c3718a1 Mon Sep 17 00:00:00 2001 From: Stas Seliverstov Date: Sat, 5 Aug 2017 04:47:45 +0300 Subject: [PATCH 2/2] changes --- allure-behave/features/steps/behave_steps.py | 2 +- allure-behave/tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/allure-behave/features/steps/behave_steps.py b/allure-behave/features/steps/behave_steps.py index 4c9e3e66..2198d681 100644 --- a/allure-behave/features/steps/behave_steps.py +++ b/allure-behave/features/steps/behave_steps.py @@ -27,7 +27,7 @@ def hooks_implementations(context): @when(u'I run behave with allure formatter with options "{args}"') def run_behave_with_allure(context, **kwargs): def run(context, **kwargs): - cmd_args = '--capture-stderr -f allure_behave.formatter:AllureFormatter' + cmd_args = '-f allure_behave.formatter:AllureFormatter' cmd = '{options} {cmd}'.format(cmd=cmd_args, options=kwargs.get('args', '')) config = Configuration(command_args=cmd) diff --git a/allure-behave/tox.ini b/allure-behave/tox.ini index 35636ced..8b705240 100644 --- a/allure-behave/tox.ini +++ b/allure-behave/tox.ini @@ -21,7 +21,7 @@ deps= commands= python setup.py develop rm -rf {envtmpdir}/* - behave --no-capture -f allure_behave.formatter:AllureFormatter -o {envtmpdir}/allrue-result -f pretty {posargs: ./features} + behave -f allure_behave.formatter:AllureFormatter -o {envtmpdir}/allrue-result -f pretty {posargs: ./features} [testenv:demo]