Skip to content

Commit ae969ae

Browse files
Merge branch 'master' into fix_failing_reports_serving
2 parents 1be6e47 + b249c0f commit ae969ae

File tree

15 files changed

+177
-24
lines changed

15 files changed

+177
-24
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
allure-pytest-bdd,
1717
allure-robotframework
1818
]
19-
python-version: [3.6, 3.7, 3.8, 3.9]
19+
python-version: [3.7, 3.8, 3.9, "3.10"]
2020
include:
21-
- python-version: 3.9
21+
- python-version: 3.10
2222
static-check: yes
2323
exclude:
2424
- python-version: 3.6

allure-behave/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
'Topic :: Software Development :: Testing :: BDD',
1313
'Programming Language :: Python :: 3',
1414
'Programming Language :: Python :: 3 :: Only',
15-
'Programming Language :: Python :: 3.6',
1615
'Programming Language :: Python :: 3.7',
1716
'Programming Language :: Python :: 3.8',
1817
'Programming Language :: Python :: 3.9',
18+
'Programming Language :: Python :: 3.10',
1919
]
2020

2121
setup_requires = [

allure-behave/tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39}
3+
py{37,38,39,310}
44
static-check
55

66
[testenv]
@@ -26,7 +26,7 @@ commands =
2626
# https://github.com/allure-framework/allure-python/issues/321
2727
passenv = HOME
2828

29-
#basepython = python3.6
29+
#basepython = python3.7
3030

3131
setenv =
3232
TEST_TMP={envtmpdir}
@@ -51,7 +51,7 @@ commands=
5151
[testenv:behave-master]
5252
passenv = HOME
5353

54-
basepython = python3.6
54+
basepython = python3.7
5555

5656
setenv =
5757
TEST_TMP={envtmpdir}

allure-nose2/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
'Topic :: Software Development :: Testing',
1212
'Programming Language :: Python :: 3',
1313
'Programming Language :: Python :: 3 :: Only',
14-
'Programming Language :: Python :: 3.6',
1514
'Programming Language :: Python :: 3.7',
1615
'Programming Language :: Python :: 3.8',
1716
'Programming Language :: Python :: 3.9',
17+
'Programming Language :: Python :: 3.10',
1818
]
1919

2020
setup_requires = [

allure-nose2/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39}
3+
py{37,38,39,310}
44
static-check
55

66
[testenv]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from pytest_bdd import scenario
2+
import pytest
23

34

5+
@pytest.mark.skip(reason="https://github.com/pytest-dev/pytest-bdd/issues/447")
46
@scenario("../features/outline.feature", "Scenario outline")
57
def test_scenario_outline():
68
pass

allure-pytest-bdd/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39}
3+
py{37,38,39,310}
44

55
[testenv]
66
passenv = HOME

allure-pytest/test/acceptance/attachment/attachment_step_test.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,35 @@ def test_step_with_attachment(executed_docstring_path):
1414
),
1515
)
1616
)
17+
18+
19+
def test_step_with_thread_and_attachment(allured_testdir):
20+
allured_testdir.testdir.makepyfile(
21+
"""
22+
from concurrent.futures import ThreadPoolExecutor
23+
24+
import allure
25+
import pytest
26+
27+
@allure.step("thread {x}")
28+
def parallel_step(x=1):
29+
allure.attach("text", str(x), allure.attachment_type.TEXT)
30+
31+
32+
def test_thread():
33+
with allure.step("Start in thread"):
34+
with ThreadPoolExecutor(max_workers=2) as executor:
35+
f_result = executor.map(parallel_step, [1, 2])
36+
"""
37+
)
38+
39+
allured_testdir.run_with_allure()
40+
41+
assert_that(allured_testdir.allure_report,
42+
has_test_case("test_thread",
43+
has_step("Start in thread",
44+
has_step("thread 1", has_attachment(name="1")),
45+
has_step("thread 2", has_attachment(name="2")),
46+
)
47+
)
48+
)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
from allure_commons_test.report import has_test_case
2+
from allure_commons_test.result import has_step
3+
from hamcrest import assert_that
4+
5+
6+
def test_step_with_thread(allured_testdir):
7+
allured_testdir.testdir.makepyfile(
8+
"""
9+
from concurrent.futures import ThreadPoolExecutor
10+
11+
import allure
12+
13+
@allure.step("thread {x}")
14+
def parallel_step(x=1):
15+
with allure.step("Sub-step in thread"):
16+
pass
17+
18+
19+
def test_thread():
20+
with allure.step("Start in thread"):
21+
with ThreadPoolExecutor(max_workers=2) as executor:
22+
executor.map(parallel_step, [1, 2])
23+
"""
24+
)
25+
26+
allured_testdir.run_with_allure()
27+
28+
assert_that(allured_testdir.allure_report,
29+
has_test_case("test_thread",
30+
has_step("Start in thread",
31+
has_step("thread 1", has_step("Sub-step in thread")),
32+
has_step("thread 2")
33+
)
34+
)
35+
)
36+
37+
38+
def test_step_with_reused_threads(allured_testdir):
39+
allured_testdir.testdir.makepyfile(
40+
"""
41+
from concurrent.futures import ThreadPoolExecutor
42+
43+
import allure
44+
import random
45+
from time import sleep
46+
47+
@allure.step("thread {x}")
48+
def parallel_step(x=1):
49+
sleep(random.randint(0, 3))
50+
51+
def test_thread():
52+
with ThreadPoolExecutor(max_workers=2) as executor:
53+
executor.map(parallel_step, range(1, 4))
54+
with allure.step("Reuse previous threads"):
55+
with ThreadPoolExecutor(max_workers=2) as executor:
56+
executor.map(parallel_step, range(1, 4))
57+
58+
"""
59+
)
60+
61+
allured_testdir.run_with_allure()
62+
63+
assert_that(allured_testdir.allure_report,
64+
has_test_case("test_thread",
65+
has_step("thread 1"),
66+
has_step("thread 2"),
67+
has_step("thread 3"),
68+
has_step("Reuse previous threads",
69+
has_step("thread 1"),
70+
has_step("thread 2"),
71+
has_step("thread 3"),
72+
),
73+
)
74+
)

allure-pytest/tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39}
3+
py{37,38,39,310}
44
xdist
55
integration
66
static-check
@@ -33,7 +33,7 @@ description = Test integration with pytest-flakes
3333

3434
passenv = HOME
3535

36-
basepython = python3.6
36+
basepython = python3.7
3737

3838
setenv = ALLURE_INDENT_OUTPUT=yep
3939

@@ -81,7 +81,7 @@ commands =
8181
# `tox -e demo -- -k test_single_feature_label` or
8282
# `tox -e demo -- ./test/steps/`
8383
[testenv:demo]
84-
basepython = python3.5
84+
basepython = python3.7
8585

8686
passenv = HOME
8787

0 commit comments

Comments
 (0)