Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3f57b1

Browse files
QuLogicArchangeGabriel
authored andcommitted
Backport PR #12154: Avoid triggering deprecation warnings with pytest 3.8.
1 parent 8482916 commit f3f57b1

6 files changed

Lines changed: 13 additions & 15 deletions

File tree

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ install:
6666
- activate test-environment
6767
- echo %PYTHON_VERSION% %TARGET_ARCH%
6868
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
69-
- pip install -q "pytest!=3.3.0,>=3.2.0,<3.8" "pytest-cov>=2.3.1"
69+
- pip install -q "pytest>=3.6.0,<3.8" "pytest-cov>=2.3.1"
7070
pytest-rerunfailures pytest-timeout pytest-xdist
7171

7272
# Apply patch to `subprocess` on Python versions > 2 and < 3.6.3

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ env:
5353
- PANDAS=
5454
- PILLOW=pillow
5555
- PYPARSING=pyparsing
56-
# pytest-timeout master depends on pytest>=3.6. Testing with pytest 3.1 is
57-
# still supported; this is tested by the first matrix entry.
5856
- PYTEST='pytest>=3.6,<3.8'
5957
- PYTEST_COV=pytest-cov
6058
- PYTEST_RERUNFAILURES=pytest-rerunfailures
@@ -80,7 +78,7 @@ matrix:
8078
- NUMPY=numpy==1.7.1
8179
- PANDAS='pandas<0.21.0'
8280
- PYPARSING=pyparsing==2.0.1
83-
- PYTEST=pytest==3.1.0
81+
- PYTEST=pytest==3.6.0
8482
- PYTEST_COV=pytest-cov==2.3.1
8583
- PYTEST_TIMEOUT=pytest-timeout==1.2.1 # Newer pytest-timeouts don't support pytest <3.4.
8684
- PYTEST_RERUNFAILURES='pytest-rerunfailures<5' # 5 needs pytest>=3.6

doc/devel/contributing.rst

Lines changed: 3 additions & 3 deletions
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 .
@@ -148,11 +148,11 @@ environment is set up properly::
148148
.. _pep8: https://pep8.readthedocs.io/en/latest/
149149
.. _mock: https://docs.python.org/dev/library/unittest.mock.html
150150
.. _Ghostscript: https://www.ghostscript.com/
151-
.. _Inkscape: https://inkscape.org>
151+
.. _Inkscape: https://inkscape.org/
152152

153153
.. note::
154154

155-
**Additional dependencies for testing**: pytest_ (version 3.1 or later),
155+
**Additional dependencies for testing**: pytest_ (version 3.6 or later),
156156
mock_ (if Python 2), Ghostscript_, Inkscape_
157157

158158
.. seealso::

doc/devel/testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ Requirements
2222

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

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

29-
- pytest_ (>=3.1)
29+
- pytest_ (>=3.6)
3030
- mock_, when running Python 2
3131
- Ghostscript_ (to render PDF files)
3232
- Inkscape_ (to render SVG files)

lib/matplotlib/testing/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ def mpl_test_settings(request):
2424
original_settings = matplotlib.rcParams.copy()
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.

setupext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ def get_namespace_packages(self):
785785

786786
class Tests(OptionalPackage):
787787
name = "tests"
788-
pytest_min_version = '3.1'
788+
pytest_min_version = '3.6'
789789
default_config = False
790790

791791
def check(self):

0 commit comments

Comments
 (0)