Skip to content

Commit

Permalink
mimics @pytest.mark.skipif decorator with unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 14, 2024
1 parent f145ac4 commit 05686d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,12 @@ def warns(warning, match=None):
return unittest.TestCase().assertWarns(warning)

class mark:

@staticmethod
def skipif(condition, reason=""):
"""Mimics `@pytest.mark.skipif` decorator."""
return unittest.skipIf(condition, reason)

class xdist_group:
"""Mimics `@pytest.mark.xdist_group` decorator (no-op)."""

Expand Down

0 comments on commit 05686d7

Please sign in to comment.