Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for fake_pytest.skip
Browse files Browse the repository at this point in the history
giampaolo committed Oct 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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
@@ -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)

0 comments on commit 73c6027

Please sign in to comment.