Skip to content

Commit

Permalink
add test for fake_pytest.skip
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 15, 2024
1 parent 702a311 commit 73c6027
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions psutil/tests/test_testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,18 @@ def foo(self):
assert not result.wasSuccessful()
assert len(result.skipped) == 0

def test_skip(self):
class TestCase(unittest.TestCase):
def foo(self):
fake_pytest.skip("reason")

assert 1 == 1 # noqa

result = self.run_test_class(TestCase("foo"))
assert result.wasSuccessful()
assert len(result.skipped) == 1
assert result.skipped[0][1] == "reason"

def test_main(self):
tmpdir = self.get_testfn(dir=HERE)
os.mkdir(tmpdir)
Expand Down

0 comments on commit 73c6027

Please sign in to comment.