File tree Expand file tree Collapse file tree 2 files changed +42
-3
lines changed Expand file tree Collapse file tree 2 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ def pytest_runtest_call(self, item):
100
100
uuid = self ._cache .get (item .nodeid )
101
101
test_result = self .allure_logger .get_test (uuid )
102
102
if test_result :
103
+ self .allure_logger .drop_test (uuid )
104
+ self .allure_logger .schedule_test (uuid , test_result )
103
105
test_result .start = now ()
104
106
yield
105
107
if test_result :
Original file line number Diff line number Diff line change 1
1
import allure
2
- from hamcrest import assert_that
3
- from allure_commons_test .report import has_test_case
4
- from allure_commons_test .container import has_container
5
2
from allure_commons_test .container import has_before
3
+ from allure_commons_test .container import has_container
4
+ from allure_commons_test .report import has_test_case
5
+ from allure_commons_test .result import has_step
6
+ from hamcrest import assert_that , not_ , all_of
6
7
7
8
8
9
@allure .feature ("Fixture" )
@@ -25,3 +26,39 @@ def test_yield_fixture(executed_docstring_source):
25
26
),
26
27
)
27
28
)
29
+
30
+
31
+ def test_opened_step_function (executed_docstring_source ):
32
+ """
33
+ >>> import allure
34
+ >>> import pytest
35
+
36
+ >>> @pytest.fixture()
37
+ ... def yield_fixture():
38
+ ... with allure.step("Opened step"):
39
+ ... yield
40
+
41
+ >>> def test_opened_step(yield_fixture):
42
+ ... with allure.step("Body step"):
43
+ ... pass
44
+ """
45
+
46
+ assert_that (
47
+ executed_docstring_source .allure_report ,
48
+ has_test_case (
49
+ "test_opened_step" ,
50
+ all_of (
51
+ has_step ("Body step" ),
52
+ has_container (
53
+ executed_docstring_source .allure_report ,
54
+ has_before (
55
+ "yield_fixture" ,
56
+ has_step (
57
+ "Opened step" ,
58
+ not_ (has_step ("Body step" ))
59
+ )
60
+ )
61
+ ),
62
+ )
63
+ )
64
+ )
You can’t perform that action at this time.
0 commit comments