diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-04-25 00:39:28 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-04-25 00:39:28 +0200 |
commit | b805159ca9461fc12c68a17ec8b94ad06d6d4807 (patch) | |
tree | 12bff1fcf6920a7cb048361a145bb9cbe1ee4eff | |
parent | 5be833b45ad5b7b9fc6587718cafeb8a44476fca (diff) | |
download | psutil-b805159ca9461fc12c68a17ec8b94ad06d6d4807.tar.gz |
assert is class
-rw-r--r-- | psutil/tests/__init__.py | 4 | ||||
-rwxr-xr-x | psutil/tests/runner.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index b864d475..f831d6d3 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -15,6 +15,7 @@ import ctypes import errno import functools import gc +import inspect import os import random import re @@ -803,7 +804,8 @@ def serialtest(klass): class' unit tests will be run serially (1 process). """ # assert issubclass(klass, unittest.TestCase), klass - klass._serialtest = True + assert inspect.isclass(klass), klass + klass.__serialtest = True return klass diff --git a/psutil/tests/runner.py b/psutil/tests/runner.py index 181168cf..329819ea 100755 --- a/psutil/tests/runner.py +++ b/psutil/tests/runner.py @@ -128,7 +128,7 @@ class _Runner: parallel = unittest.TestSuite() for obj in self._iter_testmod_classes(): test = loadTestsFromTestCase(obj) - if getattr(obj, '_serialtest', False): + if getattr(obj, '__serialtest', False): serial.addTest(test) else: parallel.addTest(test) |