diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2022-12-30 22:21:09 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2022-12-30 22:21:09 +0100 |
commit | c6b71453653609827f74aa074989ae4b9da69ece (patch) | |
tree | c060cb97f31cff5d90cdf52d878e8bd299b643d4 | |
parent | b73d7ee952db293c6bee4397e13b2039a3d78d9d (diff) | |
download | psutil-c6b71453653609827f74aa074989ae4b9da69ece.tar.gz |
fix make test-coverage target
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | psutil/tests/__init__.py | 3 | ||||
-rwxr-xr-x | psutil/tests/test_testutils.py | 2 | ||||
-rw-r--r-- | pyproject.toml | 3 |
4 files changed, 5 insertions, 5 deletions
@@ -177,7 +177,7 @@ test-coverage: ## Run test coverage. ${MAKE} build # Note: coverage options are controlled by .coveragerc file rm -rf .coverage htmlcov - $(TEST_PREFIX) $(PYTHON) -m coverage run $(TSCRIPT) + $(TEST_PREFIX) $(PYTHON) -m coverage run -m unittest -v $(PYTHON) -m coverage report @echo "writing results to htmlcov/index.html" $(PYTHON) -m coverage html diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index ec9c7480..f66ff813 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -87,7 +87,7 @@ __all__ = [ "HAS_IONICE", "HAS_MEMORY_MAPS", "HAS_PROC_CPU_NUM", "HAS_RLIMIT", "HAS_SENSORS_BATTERY", "HAS_BATTERY", "HAS_SENSORS_FANS", "HAS_SENSORS_TEMPERATURES", "HAS_MEMORY_FULL_INFO", "MACOS_11PLUS", - "MACOS_12PLUS", + "MACOS_12PLUS", "COVERAGE", # subprocesses 'pyrun', 'terminate', 'reap_children', 'spawn_testproc', 'spawn_zombie', 'spawn_children_pair', @@ -128,6 +128,7 @@ PYPY = '__pypy__' in sys.builtin_module_names APPVEYOR = 'APPVEYOR' in os.environ GITHUB_ACTIONS = 'GITHUB_ACTIONS' in os.environ or 'CIBUILDWHEEL' in os.environ CI_TESTING = APPVEYOR or GITHUB_ACTIONS +COVERAGE = 'COVERAGE_RUN' in os.environ # are we a 64 bit process? IS_64BIT = sys.maxsize > 2 ** 32 diff --git a/psutil/tests/test_testutils.py b/psutil/tests/test_testutils.py index dd98538c..0298ea4e 100755 --- a/psutil/tests/test_testutils.py +++ b/psutil/tests/test_testutils.py @@ -27,6 +27,7 @@ from psutil._common import open_binary from psutil._common import open_text from psutil._common import supports_ipv6 from psutil.tests import CI_TESTING +from psutil.tests import COVERAGE from psutil.tests import HAS_CONNECTIONS_UNIX from psutil.tests import PYTHON_EXE from psutil.tests import PsutilTestCase @@ -368,6 +369,7 @@ class TestMemLeakClass(TestMemoryLeak): @retry_on_failure() @unittest.skipIf(CI_TESTING, "skipped on CI") + @unittest.skipIf(COVERAGE, "skipped during test coverage") def test_leak_mem(self): ls = [] diff --git a/pyproject.toml b/pyproject.toml index 87b84fc6..7f3b43d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,6 @@ force_single_line = true # one import per line lines_after_imports = 2 # blank spaces after import section [tool.coverage.report] -include = [ - "*psutil*" -] omit = [ "psutil/_compat.py", "psutil/tests/*", |