Skip to content

Avoid triggering deprecation warnings with pytest 3.8. #12154

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
Sep 19, 2018
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
6 changes: 3 additions & 3 deletions doc/devel/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ value.
Installing Matplotlib in developer mode
---------------------------------------

To install Matplotlib (and compile the c-extensions) run the following
To install Matplotlib (and compile the C-extensions) run the following
command from the top-level directory ::

python -mpip install -ve .
Expand Down Expand Up @@ -147,11 +147,11 @@ environment is set up properly::
.. _pytest: http://doc.pytest.org/en/latest/
.. _pep8: https://pep8.readthedocs.io/en/latest/
.. _Ghostscript: https://www.ghostscript.com/
.. _Inkscape: https://inkscape.org>
.. _Inkscape: https://inkscape.org/

.. note::

**Additional dependencies for testing**: pytest_ (version 3.4 or later),
**Additional dependencies for testing**: pytest_ (version 3.6 or later),
Ghostscript_, Inkscape_

.. seealso::
Expand Down
4 changes: 2 additions & 2 deletions doc/devel/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Requirements

Install the latest version of Matplotlib as documented in
:ref:`installing_for_devs` In particular, follow the instructions to use a
local FreeType build
local FreeType build.

The following software is required to run the tests:

- pytest_ (>=3.4)
- pytest_ (>=3.6)
- Ghostscript_ (to render PDF files)
- Inkscape_ (to render SVG files)

Expand Down
10 changes: 5 additions & 5 deletions lib/matplotlib/testing/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ def mpl_test_settings(request):
with _cleanup_cm():

backend = None
backend_marker = request.keywords.get('backend')
backend_marker = request.node.get_closest_marker('backend')
if backend_marker is not None:
assert len(backend_marker.args) == 1, \
"Marker 'backend' must specify 1 backend."
backend = backend_marker.args[0]
backend, = backend_marker.args
prev_backend = matplotlib.get_backend()

style = '_classic_test' # Default of cleanup and image_comparison too.
style_marker = request.keywords.get('style')
style_marker = request.node.get_closest_marker('style')
if style_marker is not None:
assert len(style_marker.args) == 1, \
"Marker 'style' must specify 1 style."
style = style_marker.args[0]
style, = style_marker.args

matplotlib.testing.setup()
if backend is not None:
Expand Down Expand Up @@ -64,7 +64,7 @@ def mpl_image_comparison_parameters(request, extension):
# pytest won't get confused.
# We annotate the decorated function with any parameters captured by this
# fixture so that they can be used by the wrapper in image_comparison.
baseline_images = request.keywords['baseline_images'].args[0]
baseline_images, = request.node.get_closest_marker('baseline_images').args
if baseline_images is None:
# Allow baseline image list to be produced on the fly based on current
# parametrization.
Expand Down
2 changes: 1 addition & 1 deletion requirements/testing/travis35.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python-dateutil==2.1
numpy==1.10.0
pandas<0.21.0
pyparsing==2.0.1
pytest==3.4
pytest==3.6
pytest-cov==2.3.1
pytest-timeout==1.2.1 # Newer pytest-timeouts don't support pytest 3.4.
sphinx==1.3
4 changes: 1 addition & 3 deletions requirements/testing/travis_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ cycler
numpy
pillow
pyparsing
# pytest-timeout master depends on pytest>=3.6. Testing with pytest 3.4 is
# still supported; this is tested by the first travis python 3.5 build
pytest>=3.6
pytest
pytest-cov
pytest-faulthandler
pytest-rerunfailures
Expand Down
2 changes: 1 addition & 1 deletion setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def get_namespace_packages(self):

class Tests(OptionalPackage):
name = "tests"
pytest_min_version = '3.4'
pytest_min_version = '3.6'
default_config = False

def check(self):
Expand Down