Skip to content

Switch to pytest-pep8. #8001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ env:
- OPENBLAS_NUM_THREADS=1
- PANDAS=
- NPROC=2
- TEST_ARGS=--no-pep8
- INSTALL_PEP8=
- RUN_PEP8=
- NOSE_ARGS="-j $NPROC"
- PYTEST_ARGS="-ra --maxfail=1 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
- PYTHON_ARGS=
Expand All @@ -61,9 +62,9 @@ matrix:
- python: 3.5
env: BUILD_DOCS=true
- python: 3.5
env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1 TEST_ARGS=
env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1
- python: 3.6
env: USE_PYTEST=true DELETE_FONT_CACHE=1 TEST_ARGS=
env: USE_PYTEST=true DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you run pep8 without installing it? The two options seem redundant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the one option handles optionally installing it on builds that use it, the other handles adding the argument to running pytest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It be easier to have a boolean flag IMO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you have to have bash code that checks the boolean and manually install. I like this style better because the environment variables are always defined--less branching. It actually simplifies .travis.yml.

- python: "nightly"
env: PRE=--pre
- os: osx
Expand Down Expand Up @@ -113,14 +114,14 @@ install:
pip install --upgrade setuptools
- |
# Install dependencies from pypi
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS pep8 cycler coveralls coverage $MOCK
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS cycler coveralls coverage $MOCK
pip install $PRE -r doc-requirements.txt

# Install nose from a build which has partial
# support for python36 and suport for coverage output suppressing
pip install git+https://github.com/jenshnielsen/nose.git@matplotlibnose
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
pip install $PRE pytest 'pytest-cov>=2.3.1' pytest-timeout pytest-xdist pytest-faulthandler
pip install $PRE pytest 'pytest-cov>=2.3.1' pytest-timeout pytest-xdist pytest-faulthandler $INSTALL_PEP8

# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
Expand Down Expand Up @@ -154,13 +155,12 @@ script:
if [[ $DELETE_FONT_CACHE == 1 ]]; then
rm -rf ~/.cache/matplotlib
fi
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples
if [[ $USE_PYTEST == false ]]; then
echo The following args are passed to nose $NOSE_ARGS
echo The following args are passed to nose $NOSE_ARGS $RUN_PEP8
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
python tests.py $NOSE_ARGS $TEST_ARGS
python tests.py $NOSE_ARGS $RUN_PEP8
else
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $RUN_PEP8
fi
else
# Workaround for pytest-xdist flaky colletion order
Expand All @@ -169,8 +169,8 @@ script:
export PYTHONHASHSEED=$(shuf -i 1-4294967295 -n 1)
echo PYTHONHASHSEED=$PYTHONHASHSEED

echo The following args are passed to pytest $PYTEST_ARGS
py.test $PYTEST_ARGS $TEST_ARGS
echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8
py.test $PYTEST_ARGS $RUN_PEP8
fi
else
cd doc
Expand Down
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ environment:
CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd"
# Workaround for https://github.com/conda/conda-build/issues/636
PYTHONIOENCODING: "UTF-8"
TEST_ARGS: --no-pep8
PYTEST_ARGS: -ra --timeout=300 --durations=25 #--cov-report= --cov=lib #-n %NUMBER_OF_PROCESSORS%
USE_PYTEST: no
#PYTHONHASHSEED: 0 # Workaround for pytest-xdist flaky colletion order
Expand Down Expand Up @@ -137,8 +136,8 @@ test_script:
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
# tests
- if x%USE_PYTEST% == xyes echo The following args are passed to pytest %PYTEST_ARGS%
- if x%USE_PYTEST% == xyes py.test %PYTEST_ARGS% %TEST_ARGS%
- if x%USE_PYTEST% == xno python tests.py %TEST_ARGS%
- if x%USE_PYTEST% == xyes py.test %PYTEST_ARGS%
- if x%USE_PYTEST% == xno python tests.py
# Generate a html for visual tests
- python visual_tests.py

Expand Down
286 changes: 0 additions & 286 deletions lib/matplotlib/tests/test_coding_standards.py

This file was deleted.

Loading