Skip to content

Commit 1f7d3ce

Browse files
committed
Fix case of incorrect status when test was skipped in setup.
When some test was skipped in the setup, RP wrongly identified its status, by assigning to it the status of the last non-skipped test. Test to reproduce: """ import pytest @pytest.fixture def skip_in_setup(): pytest.skip() def test_that_fails(): assert False @pytest.mark.usefixtures("skip_in_setup") def test_skip_in_setup(self): pass """ In this example the first test fails and the second is skipped. RP identified both as failures.
1 parent 68053a2 commit 1f7d3ce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pytest_reportportal/listener.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def pytest_runtest_makereport(self):
4646
)
4747

4848
if report.when == 'setup':
49+
self.result = None
4950
if report.failed:
5051
# This happens for example when a fixture fails to run
5152
# causing the test to error

0 commit comments

Comments
 (0)