Skip to content

Commit ca444e2

Browse files
authored
Merge pull request matplotlib#12154 from anntzer/pytest38
Avoid triggering deprecation warnings with pytest 3.8.
2 parents 51c77d6 + a3b9ef7 commit ca444e2

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

doc/devel/contributing.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ value.
109109
Installing Matplotlib in developer mode
110110
---------------------------------------
111111

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

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

152152
.. note::
153153

154-
**Additional dependencies for testing**: pytest_ (version 3.4 or later),
154+
**Additional dependencies for testing**: pytest_ (version 3.6 or later),
155155
Ghostscript_, Inkscape_
156156

157157
.. seealso::

doc/devel/testing.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Requirements
2121

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

2626
The following software is required to run the tests:
2727

28-
- pytest_ (>=3.4)
28+
- pytest_ (>=3.6)
2929
- Ghostscript_ (to render PDF files)
3030
- Inkscape_ (to render SVG files)
3131

lib/matplotlib/testing/conftest.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ def mpl_test_settings(request):
2424
with _cleanup_cm():
2525

2626
backend = None
27-
backend_marker = request.keywords.get('backend')
27+
backend_marker = request.node.get_closest_marker('backend')
2828
if backend_marker is not None:
2929
assert len(backend_marker.args) == 1, \
3030
"Marker 'backend' must specify 1 backend."
31-
backend = backend_marker.args[0]
31+
backend, = backend_marker.args
3232
prev_backend = matplotlib.get_backend()
3333

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

4141
matplotlib.testing.setup()
4242
if backend is not None:
@@ -64,7 +64,7 @@ def mpl_image_comparison_parameters(request, extension):
6464
# pytest won't get confused.
6565
# We annotate the decorated function with any parameters captured by this
6666
# fixture so that they can be used by the wrapper in image_comparison.
67-
baseline_images = request.keywords['baseline_images'].args[0]
67+
baseline_images, = request.node.get_closest_marker('baseline_images').args
6868
if baseline_images is None:
6969
# Allow baseline image list to be produced on the fly based on current
7070
# parametrization.

requirements/testing/travis35.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ python-dateutil==2.1
55
numpy==1.10.0
66
pandas<0.21.0
77
pyparsing==2.0.1
8-
pytest==3.4
8+
pytest==3.6
99
pytest-cov==2.3.1
1010
pytest-timeout==1.2.1 # Newer pytest-timeouts don't support pytest 3.4.
1111
sphinx==1.3

requirements/testing/travis_all.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ cycler
66
numpy
77
pillow
88
pyparsing
9-
# pytest-timeout master depends on pytest>=3.6. Testing with pytest 3.4 is
10-
# still supported; this is tested by the first travis python 3.5 build
11-
pytest>=3.6
9+
pytest
1210
pytest-cov
1311
pytest-faulthandler
1412
pytest-rerunfailures

setupext.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def get_namespace_packages(self):
681681

682682
class Tests(OptionalPackage):
683683
name = "tests"
684-
pytest_min_version = '3.4'
684+
pytest_min_version = '3.6'
685685
default_config = False
686686

687687
def check(self):

0 commit comments

Comments
 (0)