Skip to content

Commit 5e9128b

Browse files
authored
workaround for PR with parallel support (fixes #321 via #342)
1 parent 7b56b03 commit 5e9128b

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

allure-behave/src/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ def get_status(exception):
8686

8787
def step_status_details(result):
8888
if result.exception:
89-
return StatusDetails(message=format_exception(type(result.exception), result.exception),
90-
trace=format_traceback(result.exc_traceback))
89+
# workaround for https://github.com/behave/behave/pull/616
90+
trace = result.exc_traceback if type(result.exc_traceback) == list else format_traceback(result.exc_traceback)
91+
return StatusDetails(message=format_exception(type(result.exception), result.exception), trace=trace)
92+
9193
elif result.status == 'undefined':
9294
message = '\nYou can implement step definitions for undefined steps with these snippets:\n\n'
9395
message += make_undefined_step_snippet(result)

allure-behave/tox.ini

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,37 @@ commands=
2020
rm -rf {envtmpdir}/*
2121
behave -f allure_behave.formatter:AllureFormatter -o {envtmpdir}/allrue-result -f pretty {posargs: ./features}
2222

23+
[testenv:xrg-eparallel]
24+
# https://github.com/behave/behave/pull/616
25+
# https://github.com/allure-framework/allure-python/issues/321
26+
passenv = HOME
27+
28+
basepython = python3.6
29+
30+
setenv =
31+
TEST_TMP={envtmpdir}
32+
ALLURE_INDENT_OUTPUT=yep
33+
34+
whitelist_externals = rm
35+
36+
deps=
37+
{distshare}/allure-python-commons-2*.zip
38+
{distshare}/allure-python-commons-test-2*.zip
39+
40+
commands=
41+
pip uninstall -y behave
42+
pip install git+git://github.com/behave/behave.git@refs/pull/616/head
43+
rm -rf {envtmpdir}/*
44+
behave --processes 3 \
45+
--parallel-element feature \
46+
-f allure_behave.formatter:AllureFormatter \
47+
-o {envtmpdir}/allrue-result \
48+
-f pretty {posargs: ./features}
2349

2450
[testenv:behave-master]
2551
passenv = HOME
2652

27-
basepython = python3.5
53+
basepython = python3.6
2854

2955
setenv =
3056
TEST_TMP={envtmpdir}

0 commit comments

Comments
 (0)