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):
100100 uuid = self ._cache .get (item .nodeid )
101101 test_result = self .allure_logger .get_test (uuid )
102102 if test_result :
103+ self .allure_logger .drop_test (uuid )
104+ self .allure_logger .schedule_test (uuid , test_result )
103105 test_result .start = now ()
104106 yield
105107 if test_result :
Original file line number Diff line number Diff line change 11import 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
52from 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
67
78
89@allure .feature ("Fixture" )
@@ -25,3 +26,39 @@ def test_yield_fixture(executed_docstring_source):
2526 ),
2627 )
2728 )
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