Skip to content

Commit

Permalink
Fake unittest.TestCase.subTest for Python 2.7
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
hugovk committed Apr 15, 2022
1 parent 4bc28e5 commit 9f4dcae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,10 @@ def __str__(self):
def runTest(self):
pass

@contextlib.contextmanager
def subTest(self, *args, **kw):
# fake it for python 2.7
yield

# monkey patch default unittest.TestCase
unittest.TestCase = TestCase
Expand Down

0 comments on commit 9f4dcae

Please sign in to comment.