summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-04-25 00:39:28 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2020-04-25 00:39:28 +0200
commitb805159ca9461fc12c68a17ec8b94ad06d6d4807 (patch)
tree12bff1fcf6920a7cb048361a145bb9cbe1ee4eff
parent5be833b45ad5b7b9fc6587718cafeb8a44476fca (diff)
downloadpsutil-b805159ca9461fc12c68a17ec8b94ad06d6d4807.tar.gz
assert is class
-rw-r--r--psutil/tests/__init__.py4
-rwxr-xr-xpsutil/tests/runner.py2
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)