From bc43abd10c07213063129f05fcf146c99e54ebf5 Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" Date: Wed, 24 Oct 2018 15:22:46 +0000 Subject: [PATCH 01/21] Set up CI with Azure Pipelines --- azure-pipelines.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000000..5d1efbf64327 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,44 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +jobs: + +- job: 'Test' + pool: + vmImage: 'Ubuntu 16.04' + strategy: + matrix: + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + Python37: + python.version: '3.7' + maxParallel: 4 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install --upgrade pip && pip install -r requirements.txt + displayName: 'Install dependencies' + + - script: pip install -ve . + displayName: "Install self" + + - script: | + + pip install pytest + pytest --junitxml=junit/test-results.xml + displayName: 'pytest' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() + From 52cb05b14e60284c2604a44264f882590d3ecb69 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 24 Oct 2018 11:26:05 -0400 Subject: [PATCH 02/21] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5d1efbf64327..b0d4ccac2e17 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,7 +24,7 @@ jobs: versionSpec: '$(python.version)' architecture: 'x64' - - script: python -m pip install --upgrade pip && pip install -r requirements.txt + - script: python -m pip install --upgrade pip && pip install -r requirements/testing/travis_all.txt displayName: 'Install dependencies' - script: pip install -ve . From a4fd1c2d930c3607d0917ce1b5434d8521017729 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 25 Oct 2018 14:03:56 -0400 Subject: [PATCH 03/21] TST: make sure all figures are closed before testing show --- lib/matplotlib/tests/test_backend_bases.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 5310db42f956..0be354a05d7e 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -57,6 +57,7 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') def test_non_gui_warning(): + plt.close('all') plt.subplots() with pytest.warns(UserWarning) as rec: plt.show() From 7b7d2ba3b305d2fefd4041832dd399e4e527b5c6 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 25 Oct 2018 17:32:37 -0400 Subject: [PATCH 04/21] CI: update how dependencies are installed --- azure-pipelines.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b0d4ccac2e17..aa90458c65b5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,7 +24,30 @@ jobs: versionSpec: '$(python.version)' architecture: 'x64' - - script: python -m pip install --upgrade pip && pip install -r requirements/testing/travis_all.txt + - script: | + + python -m pip install --upgrade pip + pip install -r requirements/testing/travis_all.txt -r requirements/testing/travis36.txt + # GUI toolkits are pip-installable only for some versions of Python so + # don't fail if we can't install them. Make it easier to check whether the + # install was successful by trying to import the toolkit (sometimes, the + # install appears to be successful but shared libraries cannot be loaded at + # runtime, so an actual import is a better check). + python -mpip install --upgrade cairocffi>=0.8 pgi>=0.0.11.2 && + python -c 'import pgi as gi; gi.require_version("Gtk", "3.0"); from pgi.repository import Gtk' && + echo 'pgi is available' || + echo 'pgi is not available' + python -mpip install --upgrade pyqt5 && + python -c 'import PyQt5.QtCore' && + echo 'PyQt5 is available' || + echo 'PyQt5 is not available' + python -mpip install --upgrade \ + -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04 \ + wxPython && + python -c 'import wx' && + echo 'wxPython is available' || + echo 'wxPython is not available' + displayName: 'Install dependencies' - script: pip install -ve . @@ -41,4 +64,3 @@ jobs: testResultsFiles: '**/test-results.xml' testRunTitle: 'Python $(python.version)' condition: succeededOrFailed() - From c363e1fbaaa4c13f761e424ac4cfe4f09d8cf253 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 25 Oct 2018 18:23:43 -0400 Subject: [PATCH 05/21] CI: start xserver --- azure-pipelines.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa90458c65b5..eb8fb7f59850 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -49,6 +49,11 @@ jobs: echo 'wxPython is not available' displayName: 'Install dependencies' + - script: | + + export DISPLAY=:99.0 + sh -e /etc/init.d/xvfb start + displayName: 'start x server' - script: pip install -ve . displayName: "Install self" From 6909ec5d133a1efdf4a295957f1431621abc21a7 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 1 Nov 2018 17:10:44 -0400 Subject: [PATCH 06/21] CI: remove all of the GUI installation again --- azure-pipelines.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eb8fb7f59850..fc954f34d37c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,32 +28,8 @@ jobs: python -m pip install --upgrade pip pip install -r requirements/testing/travis_all.txt -r requirements/testing/travis36.txt - # GUI toolkits are pip-installable only for some versions of Python so - # don't fail if we can't install them. Make it easier to check whether the - # install was successful by trying to import the toolkit (sometimes, the - # install appears to be successful but shared libraries cannot be loaded at - # runtime, so an actual import is a better check). - python -mpip install --upgrade cairocffi>=0.8 pgi>=0.0.11.2 && - python -c 'import pgi as gi; gi.require_version("Gtk", "3.0"); from pgi.repository import Gtk' && - echo 'pgi is available' || - echo 'pgi is not available' - python -mpip install --upgrade pyqt5 && - python -c 'import PyQt5.QtCore' && - echo 'PyQt5 is available' || - echo 'PyQt5 is not available' - python -mpip install --upgrade \ - -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04 \ - wxPython && - python -c 'import wx' && - echo 'wxPython is available' || - echo 'wxPython is not available' displayName: 'Install dependencies' - - script: | - - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - displayName: 'start x server' - script: pip install -ve . displayName: "Install self" From c7ec9d1a499097fdcf8064f4572e9f62763b71ea Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 11:46:09 -0400 Subject: [PATCH 07/21] TST: open temporary file as text (not binary) --- lib/matplotlib/tests/test_backend_nbagg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_backend_nbagg.py b/lib/matplotlib/tests/test_backend_nbagg.py index f08460b892cc..fe7204af0d9b 100644 --- a/lib/matplotlib/tests/test_backend_nbagg.py +++ b/lib/matplotlib/tests/test_backend_nbagg.py @@ -13,7 +13,8 @@ def _notebook_run(nb_file): """Execute a notebook via nbconvert and collect output. :returns (parsed nb object, execution errors) """ - with tempfile.NamedTemporaryFile(suffix=".ipynb") as fout: + with tempfile.NamedTemporaryFile(suffix=".ipynb", + mode='w+t') as fout: args = ["jupyter", "nbconvert", "--to", "notebook", "--execute", "--ExecutePreprocessor.timeout=500", "--output", fout.name, nb_file] From 1d04409ec484918f981c18d779c240b7c1e5cf85 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 11:49:43 -0400 Subject: [PATCH 08/21] TST: add missing import No idea why this passes anywhere else... --- lib/matplotlib/tests/test_backends_interactive.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 0cb17c9d19f2..9b7c81918f03 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -1,4 +1,5 @@ import importlib +import importlib.util import os import signal import subprocess From 67932e96369534bc0331537b5aa80e1b13acff82 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 11:55:31 -0400 Subject: [PATCH 09/21] TST: use localfreetype on azure --- azure-pipelines.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fc954f34d37c..e8726723495b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,7 +31,11 @@ jobs: displayName: 'Install dependencies' - - script: pip install -ve . + - script: | + + export MPLLOCALFREETYPE=1 + pip install -ve . + displayName: "Install self" - script: | From 0b6ce9140928d6f15e9907653055dc368aaf077a Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 12:15:16 -0400 Subject: [PATCH 10/21] TST: tweak imports in test script + add check for server up --- lib/matplotlib/tests/test_backends_interactive.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 9b7c81918f03..cc845d279911 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -47,6 +47,7 @@ def _get_testable_interactive_backends(): # we directly invoke it from the superclass instead. _test_script = """\ import importlib +import importlib.util import sys from unittest import TestCase @@ -126,6 +127,9 @@ def test_webagg(): timeout = time.perf_counter() + _test_timeout while True: try: + retcode = proc.poll() + # check that the subprocess for the server is not dead + assert retcode is None conn = urllib.request.urlopen(url) break except urllib.error.URLError: From 1753f6b33897d1b1dd12a389d1288ad32432dd71 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 12:15:34 -0400 Subject: [PATCH 11/21] TST: move over all flags from travis invocation of pytest --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e8726723495b..06f3329f206a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,7 +41,7 @@ jobs: - script: | pip install pytest - pytest --junitxml=junit/test-results.xml + pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 displayName: 'pytest' - task: PublishTestResults@2 From 11ac9394eeffb1172c5a918f38cc64970e8f3de0 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 12:40:08 -0400 Subject: [PATCH 12/21] TST: add debugging prints --- azure-pipelines.yml | 3 +++ lib/matplotlib/tests/test_backend_bases.py | 1 + 2 files changed, 4 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 06f3329f206a..a25f1d037106 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,6 +38,9 @@ jobs: displayName: "Install self" + - script: env + displayName: 'print env' + - script: | pip install pytest diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 0be354a05d7e..4bd47fbd7607 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -59,6 +59,7 @@ def test_get_default_filename(tmpdir): def test_non_gui_warning(): plt.close('all') plt.subplots() + print(matplotlib.get_backend()) with pytest.warns(UserWarning) as rec: plt.show() assert len(rec) == 1 From ba46ce4b5cbe82e93a6b8d6fb9f6a2ccbfac0c94 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 14:07:33 -0400 Subject: [PATCH 13/21] TST: skip some tests on azure --- lib/matplotlib/tests/test_backend_bases.py | 6 +++--- lib/matplotlib/tests/test_backends_interactive.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 4bd47fbd7607..a09ec4bef444 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -3,7 +3,7 @@ import matplotlib.pyplot as plt import matplotlib.transforms as transforms import matplotlib.path as path - +import os import numpy as np import pytest @@ -57,9 +57,9 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') def test_non_gui_warning(): - plt.close('all') + pytest.mark.skipif('AZURE_HTTP_USER_AGENT' in os.environ) plt.subplots() - print(matplotlib.get_backend()) + with pytest.warns(UserWarning) as rec: plt.show() assert len(rec) == 1 diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index cc845d279911..3a25a116af67 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -119,6 +119,7 @@ def test_interactive_backend(backend): @pytest.mark.skipif(os.name == "nt", reason="Cannot send SIGINT on Windows.") def test_webagg(): + pytest.mark.skipif('AZURE_HTTP_USER_AGENT' in os.environ) pytest.importorskip("tornado") proc = subprocess.Popen([sys.executable, "-c", _test_script], env={**os.environ, "MPLBACKEND": "webagg"}) From b55fdf9c0e692929fa48fd5f0404aed0f2205019 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 14:22:56 -0400 Subject: [PATCH 14/21] TST: more debugging prints --- lib/matplotlib/tests/test_backend_bases.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index a09ec4bef444..b2c75fab76da 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -57,6 +57,7 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') def test_non_gui_warning(): + print(list(os.environ)) pytest.mark.skipif('AZURE_HTTP_USER_AGENT' in os.environ) plt.subplots() From ad0e579f0cf0699a8a629139ca6a7ed6c335b48c Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 14:36:17 -0400 Subject: [PATCH 15/21] TST: skip tests based on user name? --- lib/matplotlib/tests/test_backend_bases.py | 2 +- lib/matplotlib/tests/test_backends_interactive.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index b2c75fab76da..207519a3d3dc 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -58,7 +58,7 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') def test_non_gui_warning(): print(list(os.environ)) - pytest.mark.skipif('AZURE_HTTP_USER_AGENT' in os.environ) + pytest.mark.skipif(os.environ.get('USER', '') == 'vsts') plt.subplots() with pytest.warns(UserWarning) as rec: diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 3a25a116af67..3de273a9d2dd 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -119,7 +119,7 @@ def test_interactive_backend(backend): @pytest.mark.skipif(os.name == "nt", reason="Cannot send SIGINT on Windows.") def test_webagg(): - pytest.mark.skipif('AZURE_HTTP_USER_AGENT' in os.environ) + pytest.mark.skipif(os.environ.get('USER', '') == 'vsts') pytest.importorskip("tornado") proc = subprocess.Popen([sys.executable, "-c", _test_script], env={**os.environ, "MPLBACKEND": "webagg"}) From f8376ebca11ab4fdf9eb76e23ff549e3349c9e02 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 14:36:45 -0400 Subject: [PATCH 16/21] CI: print env right before testing --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a25f1d037106..0f1b59707c22 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,8 +42,7 @@ jobs: displayName: 'print env' - script: | - - pip install pytest + env pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 displayName: 'pytest' From 729c3bd195640f40d4c0d7660918e67c91a22021 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 16:30:34 -0400 Subject: [PATCH 17/21] TST: print out the full environment --- lib/matplotlib/tests/test_backend_bases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 207519a3d3dc..086ed0cdd0d7 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -57,7 +57,7 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') def test_non_gui_warning(): - print(list(os.environ)) + print(os.environ) pytest.mark.skipif(os.environ.get('USER', '') == 'vsts') plt.subplots() From 309fdf03d0eea80fd8723f0149434b9bbca38b02 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 16:44:18 -0400 Subject: [PATCH 18/21] CI: have I finally found a way to identify we are on azure?! --- lib/matplotlib/tests/test_backend_bases.py | 3 +-- lib/matplotlib/tests/test_backends_interactive.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 086ed0cdd0d7..bc1d6143ad7e 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -57,8 +57,7 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') def test_non_gui_warning(): - print(os.environ) - pytest.mark.skipif(os.environ.get('USER', '') == 'vsts') + pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) plt.subplots() with pytest.warns(UserWarning) as rec: diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 3de273a9d2dd..97f83799f0f3 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -119,7 +119,7 @@ def test_interactive_backend(backend): @pytest.mark.skipif(os.name == "nt", reason="Cannot send SIGINT on Windows.") def test_webagg(): - pytest.mark.skipif(os.environ.get('USER', '') == 'vsts') + pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) pytest.importorskip("tornado") proc = subprocess.Popen([sys.executable, "-c", _test_script], env={**os.environ, "MPLBACKEND": "webagg"}) From 744e7fa6c275792d7fd0da4b0ca8f0ddc21ec8d5 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 17:50:31 -0400 Subject: [PATCH 19/21] CI: Debugging prints to sort out how to make it skip --- lib/matplotlib/tests/test_backend_bases.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index bc1d6143ad7e..67c37471f899 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -57,6 +57,8 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') def test_non_gui_warning(): + print(os.environ) + print('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) plt.subplots() From 0c07d96ee534d0ae7e9775f9a1cca61db07411b2 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 18:30:48 -0400 Subject: [PATCH 20/21] =?UTF-8?q?TST:=20pytest=20marks=20work=20better=20i?= =?UTF-8?q?f=20you=20use=20them=20a=20decorators=20=F0=9F=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/matplotlib/tests/test_backend_bases.py | 4 +--- lib/matplotlib/tests/test_backends_interactive.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 67c37471f899..5929fba6f937 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -56,10 +56,8 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') +@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) def test_non_gui_warning(): - print(os.environ) - print('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) - pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) plt.subplots() with pytest.warns(UserWarning) as rec: diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 97f83799f0f3..f0fdf7fc9b97 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -117,9 +117,9 @@ def test_interactive_backend(backend): pytest.fail("The subprocess returned an error.") +@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) @pytest.mark.skipif(os.name == "nt", reason="Cannot send SIGINT on Windows.") def test_webagg(): - pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) pytest.importorskip("tornado") proc = subprocess.Popen([sys.executable, "-c", _test_script], env={**os.environ, "MPLBACKEND": "webagg"}) From b100da4c9706fe26636d3f8904e058314969f6f8 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 2 Nov 2018 18:44:25 -0400 Subject: [PATCH 21/21] TST: provide reasons for skipping tests --- lib/matplotlib/tests/test_backend_bases.py | 3 ++- lib/matplotlib/tests/test_backends_interactive.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 5929fba6f937..676686b7b1da 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -56,7 +56,8 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') -@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) +@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ, + reason="this test fails an azure for unknown reasons") def test_non_gui_warning(): plt.subplots() diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index f0fdf7fc9b97..00cbf5db91bc 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -117,7 +117,8 @@ def test_interactive_backend(backend): pytest.fail("The subprocess returned an error.") -@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ) +@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ, + reason="this test fails an azure for unknown reasons") @pytest.mark.skipif(os.name == "nt", reason="Cannot send SIGINT on Windows.") def test_webagg(): pytest.importorskip("tornado")