Skip to content

Commit

Permalink
#1058: enable warnings on make.bat, appveyor and travis
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 12, 2017
1 parent 78742c7 commit b258d82
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .ci/travis/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ python setup.py develop

# run tests (with coverage)
if [[ $PYVER == '2.7' ]] && [[ "$(uname -s)" != 'Darwin' ]]; then
coverage run psutil/tests/__main__.py
python -Wa -m coverage run psutil/tests/__main__.py
else
python psutil/tests/__main__.py
python -Wa psutil/tests/__main__.py
fi

if [ "$PYVER" == "2.7" ] || [ "$PYVER" == "3.6" ]; then
# run mem leaks test
python psutil/tests/test_memory_leaks.py
python -Wa psutil/tests/test_memory_leaks.py
# run linter (on Linux only)
if [[ "$(uname -s)" != 'Darwin' ]]; then
python -m flake8
python -Wa -m flake8
fi
fi
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ build: off

test_script:
- "%WITH_COMPILER% %PYTHON%/python -V"
- "%WITH_COMPILER% %PYTHON%/python psutil/tests/__main__.py"
- "%WITH_COMPILER% %PYTHON%/python -Wa psutil/tests/__main__.py"

after_test:
- "%WITH_COMPILER% %PYTHON%/python setup.py bdist_wheel"
Expand Down
30 changes: 15 additions & 15 deletions scripts/internal/winmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,22 +320,22 @@ def flake8():
py_files = py_files.decode()
py_files = [x for x in py_files.split() if x.endswith('.py')]
py_files = ' '.join(py_files)
sh("%s -m flake8 %s" % (PYTHON, py_files), nolog=True)
sh("%s -Wa -m flake8 %s" % (PYTHON, py_files), nolog=True)


@cmd
def test():
"""Run tests"""
install()
sh("%s %s" % (PYTHON, TSCRIPT))
sh("%s -Wa %s" % (PYTHON, TSCRIPT))


@cmd
def coverage():
"""Run coverage tests."""
# Note: coverage options are controlled by .coveragerc file
install()
sh("%s -m coverage run %s" % (PYTHON, TSCRIPT))
sh("%s -Wa -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)
Expand All @@ -345,49 +345,49 @@ def coverage():
def test_process():
"""Run process tests"""
install()
sh("%s -m unittest -v psutil.tests.test_process" % PYTHON)
sh("%s -Wa -m unittest -v psutil.tests.test_process" % PYTHON)


@cmd
def test_system():
"""Run system tests"""
install()
sh("%s -m unittest -v psutil.tests.test_system" % PYTHON)
sh("%s -Wa -m unittest -v psutil.tests.test_system" % PYTHON)


@cmd
def test_platform():
"""Run windows only tests"""
install()
sh("%s -m unittest -v psutil.tests.test_windows" % PYTHON)
sh("%s -Wa -m unittest -v psutil.tests.test_windows" % PYTHON)


@cmd
def test_misc():
"""Run misc tests"""
install()
sh("%s -m unittest -v psutil.tests.test_misc" % PYTHON)
sh("%s -Wa -m unittest -v psutil.tests.test_misc" % PYTHON)


@cmd
def test_unicode():
"""Run unicode tests"""
install()
sh("%s -m unittest -v psutil.tests.test_unicode" % PYTHON)
sh("%s -Wa -m unittest -v psutil.tests.test_unicode" % PYTHON)


@cmd
def test_connections():
"""Run connections tests"""
install()
sh("%s -m unittest -v psutil.tests.test_connections" % PYTHON)
sh("%s -Wa -m unittest -v psutil.tests.test_connections" % PYTHON)


@cmd
def test_contracts():
"""Run contracts tests"""
install()
sh("%s -m unittest -v psutil.tests.test_contracts" % PYTHON)
sh("%s -Wa -m unittest -v psutil.tests.test_contracts" % PYTHON)


@cmd
Expand All @@ -399,7 +399,7 @@ def test_by_name():
except IndexError:
sys.exit('second arg missing')
install()
sh("%s -m unittest -v %s" % (PYTHON, name))
sh("%s -Wa -m unittest -v %s" % (PYTHON, name))


@cmd
Expand All @@ -411,14 +411,14 @@ def test_script():
except IndexError:
sys.exit('second arg missing')
install()
sh("%s %s" % (PYTHON, name))
sh("%s -Wa %s" % (PYTHON, name))


@cmd
def test_memleaks():
"""Run memory leaks tests"""
install()
sh("%s psutil\\tests\\test_memory_leaks.py" % PYTHON)
sh("%s -Wa psutil\\tests\\test_memory_leaks.py" % PYTHON)


@cmd
Expand All @@ -430,13 +430,13 @@ def install_git_hooks():
@cmd
def bench_oneshot():
install()
sh("%s scripts\\internal\\bench_oneshot.py" % PYTHON)
sh("%s -Wa scripts\\internal\\bench_oneshot.py" % PYTHON)


@cmd
def bench_oneshot_2():
install()
sh("%s scripts\\internal\\bench_oneshot_2.py" % PYTHON)
sh("%s -Wa scripts\\internal\\bench_oneshot_2.py" % PYTHON)


def set_python(s):
Expand Down

0 comments on commit b258d82

Please sign in to comment.