diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-11-12 04:27:21 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-11-12 04:27:21 +0100 |
commit | 083f711e577764a7de82394469aa790a20ca058a (patch) | |
tree | 494c571de9a39f1e0e8647bbaa0d0349e4c63271 | |
parent | a8dd6ac992152dc84e0fdf87655355085f465c6f (diff) | |
download | psutil-083f711e577764a7de82394469aa790a20ca058a.tar.gz |
refactor winmake.py
-rw-r--r-- | psutil/arch/windows/process_info.c | 1 | ||||
-rwxr-xr-x | scripts/internal/winmake.py | 41 |
2 files changed, 29 insertions, 13 deletions
diff --git a/psutil/arch/windows/process_info.c b/psutil/arch/windows/process_info.c index 92095fe5..9a54d854 100644 --- a/psutil/arch/windows/process_info.c +++ b/psutil/arch/windows/process_info.c @@ -338,7 +338,6 @@ psutil_get_pids(DWORD *numberOfReturnedPIDs) { int psutil_assert_pid_exists(DWORD pid, char *err) { if (PSUTIL_TESTING) { - printf("testing\n"); if (psutil_pid_in_pids(pid) == 0) { PyErr_SetString(PyExc_AssertionError, err); return 0; diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py index a09e2896..35ce059c 100755 --- a/scripts/internal/winmake.py +++ b/scripts/internal/winmake.py @@ -174,6 +174,11 @@ def recursive_rm(*patterns): safe_rmtree(os.path.join(root, dir)) +def test_setup(): + os.environ['PYTHONWARNINGS'] = 'all' + os.environ['PSUTIL_TESTING'] = '1' + + # =================================================================== # commands # =================================================================== @@ -328,7 +333,8 @@ def flake8(): def test(): """Run tests""" install() - sh("%s -Wa %s" % (PYTHON, TSCRIPT)) + test_setup() + sh("%s %s" % (PYTHON, TSCRIPT)) @cmd @@ -336,7 +342,8 @@ def coverage(): """Run coverage tests.""" # Note: coverage options are controlled by .coveragerc file install() - sh("%s -Wa -m coverage run %s" % (PYTHON, TSCRIPT)) + test_setup() + sh("%s -m coverage run %s" % (PYTHON, TSCRIPT)) sh("%s -m coverage report" % PYTHON) sh("%s -m coverage html" % PYTHON) sh("%s -m webbrowser -t htmlcov/index.html" % PYTHON) @@ -346,49 +353,56 @@ def coverage(): def test_process(): """Run process tests""" install() - sh("%s -Wa -m unittest -v psutil.tests.test_process" % PYTHON) + test_setup() + sh("%s -m unittest -v psutil.tests.test_process" % PYTHON) @cmd def test_system(): """Run system tests""" install() - sh("%s -Wa -m unittest -v psutil.tests.test_system" % PYTHON) + test_setup() + sh("%s -m unittest -v psutil.tests.test_system" % PYTHON) @cmd def test_platform(): """Run windows only tests""" install() - sh("%s -Wa -m unittest -v psutil.tests.test_windows" % PYTHON) + test_setup() + sh("%s -m unittest -v psutil.tests.test_windows" % PYTHON) @cmd def test_misc(): """Run misc tests""" install() - sh("%s -Wa -m unittest -v psutil.tests.test_misc" % PYTHON) + test_setup() + sh("%s -m unittest -v psutil.tests.test_misc" % PYTHON) @cmd def test_unicode(): """Run unicode tests""" install() - sh("%s -Wa -m unittest -v psutil.tests.test_unicode" % PYTHON) + test_setup() + sh("%s -m unittest -v psutil.tests.test_unicode" % PYTHON) @cmd def test_connections(): """Run connections tests""" install() - sh("%s -Wa -m unittest -v psutil.tests.test_connections" % PYTHON) + test_setup() + sh("%s -m unittest -v psutil.tests.test_connections" % PYTHON) @cmd def test_contracts(): """Run contracts tests""" install() - sh("%s -Wa -m unittest -v psutil.tests.test_contracts" % PYTHON) + test_setup() + sh("%s -m unittest -v psutil.tests.test_contracts" % PYTHON) @cmd @@ -400,7 +414,8 @@ def test_by_name(): except IndexError: sys.exit('second arg missing') install() - sh("%s -Wa -m unittest -v %s" % (PYTHON, name)) + test_setup() + sh("%s -m unittest -v %s" % (PYTHON, name)) @cmd @@ -412,14 +427,16 @@ def test_script(): except IndexError: sys.exit('second arg missing') install() - sh("%s -Wa %s" % (PYTHON, name)) + test_setup() + sh("%s %s" % (PYTHON, name)) @cmd def test_memleaks(): """Run memory leaks tests""" install() - sh("%s -Wa psutil\\tests\\test_memory_leaks.py" % PYTHON) + test_setup() + sh("%s psutil\\tests\\test_memory_leaks.py" % PYTHON) @cmd |