Skip to content

Commit

Permalink
attempt 3
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jun 23, 2024
1 parent c1d0ea4 commit 13be4f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ jobs:
os: [ubuntu-latest, macos-12]
env:
CIBW_TEST_COMMAND:
make test && make test-memleaks
PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python -m pytest --tb=native -v -s {project}/psutil/tests/runner.py &&
PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python -m pytest --tb=native -v -s {project}/psutil/tests/test_memleaks.py
CIBW_TEST_EXTRAS: test
CIBW_BUILD: 'cp27-*'

Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Configurable.
PYTHON = python3
PYTHON_ENV_VARS = PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1
PYTEST_ARGS = -v --tb=native -s -o cache_dir=/tmp/psutil-pytest-cache
PYTEST_ARGS = --tb=native -v -s
ARGS =

# mandatory deps for running tests
Expand Down Expand Up @@ -141,12 +141,11 @@ setup-dev-env: ## Install GIT hooks, pip, test deps (also upgrades them).

test: ## Run all tests. To run a specific test do "make test ARGS=psutil.tests.test_system.TestDiskAPIs"
${MAKE} build
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS)
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) --ignore=psutil/tests/test_memleaks.py $(ARGS)

test-parallel: ## Run all tests in parallel.
${MAKE} build
# Note: when running in parallel pytest's `-s` and `-v` opts are ignored
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) -n auto --dist loadgroup $(ARGS)
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) --ignore=psutil/tests/test_memleaks.py -n auto --dist loadgroup $(ARGS)

test-process: ## Run process-related API tests.
${MAKE} build
Expand Down Expand Up @@ -200,7 +199,7 @@ test-coverage: ## Run test coverage.
${MAKE} build
# Note: coverage options are controlled by .coveragerc file
rm -rf .coverage htmlcov
$(PYTHON_ENV_VARS) $(PYTHON) -m coverage run -m pytest $(PYTEST_ARGS) $(ARGS)
$(PYTHON_ENV_VARS) $(PYTHON) -m coverage run -m pytest $(PYTEST_ARGS) --ignore=psutil/tests/test_memleaks.py $(ARGS)
$(PYTHON) -m coverage report
@echo "writing results to htmlcov/index.html"
$(PYTHON) -m coverage html
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ skip = [
"pp*",
]
test-command = [
"make test",
"make test-memleaks",
"env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python -m pytest --tb=native -v -s --ignore=psutil/tests/test_memleaks.py {project}/psutil/tests",
"env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/test_memleaks.py",
]
test-extras = "test"

Expand Down

0 comments on commit 13be4f3

Please sign in to comment.