[Python-modules-commits] [python-psutil] 05/08: pass PYTHONPATH to the test runner

Sandro Tosi morph at moszumanska.debian.org
Sun Oct 2 20:03:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository python-psutil.

commit d878eb36d1472bffbe7e633306250bf0bb577f3d
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Apr 10 13:17:47 2016 +0100

    pass PYTHONPATH to the test runner
---
 Makefile | 34 ++++++++--------------------------
 1 file changed, 8 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile
index e298e0a..7670cd5 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
 
 # You can set the following variables from the command line.
 PYTHON = python
+PYTHONPATH = .
 TSCRIPT = psutil/tests/runner.py
 INSTALL_OPTS =
 
@@ -73,7 +74,6 @@ install: build
 uninstall:
 	cd ..; $(PYTHON) -m pip uninstall -y -v psutil
 
-<<<<<<< 59d1042fdd4f68524fc5f231281e35602d85d86e
 # Install PIP (only if necessary).
 install-pip:
 	$(PYTHON) -c \
@@ -108,49 +108,31 @@ setup-dev-env: install-git-hooks install-pip
 # ===================================================================
 
 # Run all tests.
-test: install
-	$(PYTHON) $(TSCRIPT)
-
-# Test psutil process-related APIs.
-test-process: install
-	$(PYTHON) -m unittest -v psutil.tests.test_process
-
-# Test psutil system-related APIs.
-test-system: install
-	$(PYTHON) -m unittest -v psutil.tests.test_system
-
-# Test misc.
-test-misc: install
-	$(PYTHON) psutil/tests/test_misc.py
-
-# Test memory leaks.
-test-memleaks: install
-=======
 test:
-	$(PYTHON) $(TSCRIPT)
+	PYTHONPATH=$(PYTHONPATH) $(PYTHON) $(TSCRIPT)
 
 test-process:
-	$(PYTHON) -m unittest -v psutil.tests.test_process
+	PYTHONPATH=$(PYTHONPATH) $(PYTHON) -m unittest -v psutil.tests.test_process
 
 test-system:
-	$(PYTHON) -m unittest -v psutil.tests.test_system
+	PYTHONPATH=$(PYTHONPATH) $(PYTHON) -m unittest -v psutil.tests.test_system
 
 test-memleaks:
-	$(PYTHON) psutil/tests/test_memory_leaks.py
+	PYTHONPATH=$(PYTHONPATH) $(PYTHON) psutil/tests/test_memory_leaks.py
 
 # Run specific platform tests only.
 test-platform:
-	$(PYTHON) psutil/tests/test_`$(PYTHON) -c 'import psutil; print([x.lower() for x in ("LINUX", "BSD", "OSX", "SUNOS", "WINDOWS") if getattr(psutil, x)][0])'`.py
+	PYTHONPATH=$(PYTHONPATH) $(PYTHON) psutil/tests/test_`$(PYTHON) -c 'import psutil; print([x.lower() for x in ("LINUX", "BSD", "OSX", "SUNOS", "WINDOWS") if getattr(psutil, x)][0])'`.py
 
 # Run a specific test by name; e.g. "make test-by-name disk_" will run
 # all test methods containing "disk_" in their name.
 # Requires "pip install nose".
 test-by-name:
-	@$(PYTHON) -m nose psutil/tests/*.py --nocapture -v -m $(filter-out $@,$(MAKECMDGOALS))
+	@PYTHONPATH=$(PYTHONPATH) $(PYTHON) -m nose psutil/tests/*.py --nocapture -v -m $(filter-out $@,$(MAKECMDGOALS))
 
 # Same as above but for test_memory_leaks.py script.
 test-memleaks-by-name:
-	@$(PYTHON) -m nose test/test_memory_leaks.py --nocapture -v -m $(filter-out $@,$(MAKECMDGOALS))
+	@PYTHONPATH=$(PYTHONPATH) $(PYTHON) -m nose test/test_memory_leaks.py --nocapture -v -m $(filter-out $@,$(MAKECMDGOALS))
 
 coverage: install
 	# Note: coverage options are controlled by .coveragerc file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-psutil.git



More information about the Python-modules-commits mailing list