Skip to content

Commit

Permalink
check that test functions are not called when skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
vitor-de-araujo committed Dec 24, 2024
1 parent 2bd0814 commit 9207b92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/contrib/pytest/test_pytest_quarantine.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ def test_quarantine_outcomes_without_atr(self):
("teardown", "passed"),
]

assert len(rec.getcalls("pytest_pyfunc_call")) == 1

def test_quarantine_outcomes_with_atr(self):
self.testdir.makepyfile(test_fail_quarantined=_TEST_FAIL_QUARANTINED)

Expand Down Expand Up @@ -211,6 +213,8 @@ def test_quarantine_outcomes_with_atr(self):
("teardown", "passed"),
]

assert len(rec.getcalls("pytest_pyfunc_call")) == 6

def test_quarantine_fail_setup(self):
self.testdir.makepyfile(test_fail_quarantined=_TEST_FAIL_SETUP_QUARANTINED)

Expand Down Expand Up @@ -367,6 +371,8 @@ def _test_quarantine_outcomes(self, atr_enabled):
("teardown", "passed"),
]

assert len(rec.getcalls("pytest_pyfunc_call")) == 0 # test function is not called

def test_quarantine_fail_setup(self):
self.testdir.makepyfile(test_fail_quarantined=_TEST_FAIL_SETUP_QUARANTINED)

Expand Down

0 comments on commit 9207b92

Please sign in to comment.