summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-11-12 04:42:18 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-11-12 04:42:18 +0100
commit53984cb1fb1113b39a4dcde6f045c67f79c7572e (patch)
treed4f192e1afbe35f180d57340c6f62e422e5acaed
parent589e1c52e2ee2a5bd45fe27fe95cb212e743fd9e (diff)
parent1c3a15f637521ba5c0031283da39c733fda53e4c (diff)
downloadpsutil-53984cb1fb1113b39a4dcde6f045c67f79c7572e.tar.gz
Merge branch 'master' into 1173-debug-mode
-rw-r--r--appveyor.yml2
-rw-r--r--psutil/arch/windows/process_info.c1
-rwxr-xr-xscripts/internal/winmake.py41
3 files changed, 30 insertions, 14 deletions
diff --git a/appveyor.yml b/appveyor.yml
index 5fb1d7a3..f17b5b87 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -83,7 +83,7 @@ build: off
test_script:
- "%WITH_COMPILER% %PYTHON%/python -V"
- - "set PSUTIL_TESTING=1 && %WITH_COMPILER% %PYTHON%/python psutil/tests/__main__.py"
+ - "set PYTHONWARNINGS=all && set PSUTIL_TESTING=1 && %WITH_COMPILER% %PYTHON%/python psutil/tests/__main__.py"
after_test:
- "%WITH_COMPILER% %PYTHON%/python setup.py bdist_wheel"
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