Skip to content

Commit

Permalink
removed matplotlib.use('agg') from tests (#2763)
Browse files Browse the repository at this point in the history
- fix #2191
- use MPLBACKEND=agg in the CI environments
  - Travis
  - appveyor
  - Azure pipelines
- update CHANGELOG
  • Loading branch information
orbeckst authored Jun 16, 2020
1 parent c761ba3 commit 34288cc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ environment:
# Temporarily fall back to default MINICONDA_VERSION in ci-helpers until https://github.com/MDAnalysis/mdanalysis/issues/2311
# is fixed in ci-helpers https://github.com/astropy/ci-helpers/issues/406
# MINICONDA_VERSION: "latest"

MPLBACKEND: "agg"

matrix:
- PYTHON_VERSION: 3.6
PYTHON_ARCH: 64
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ env:
- NUMPY_VERSION=stable
- INSTALL_HOLE="true"
- CYTHON_TRACE_NOGIL=1
- MPLBACKEND=agg

matrix:
# Run a coverage test for most versions
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master')) # skip for PR merges
pool:
vmImage: 'VS2017-Win2016'
variables:
MPLBACKEND: agg
strategy:
maxParallel: 4
matrix:
Expand Down
3 changes: 2 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ The rules for this file:
* release numbers follow "Semantic Versioning" http://semver.org

------------------------------------------------------------------------------
??/??/?? richardjgowers, IAlibay, hmacdope
??/??/?? richardjgowers, IAlibay, hmacdope, orbeckst

* 2.0.0

Fixes
* TOPParser no longer guesses elements when missing atomic number records
(Issues #2449, #2651)
* Testsuite does not any more matplotlib.use('agg') (#2191)

Enhancements
* Added computation of Mean Squared Displacements (#2438, PR #2619)
Expand Down
12 changes: 4 additions & 8 deletions testsuite/MDAnalysisTests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,10 @@
os.environ['DUECREDIT_ENABLE'] = 'yes'

# Any tests that plot with matplotlib need to run with the simple agg backend
# because on Travis there is no DISPLAY set. This doesn't warn if we import
# files from the tests after loading matplotlib. This will remove unnecessary
# user warnings.
try:
import matplotlib
matplotlib.use('agg', warn=False)
except ImportError:
pass
# because on Travis there is no DISPLAY set.
#
# Instead of using matplotlib.use() we set MPLBACKEND=agg in the CI environment.
# See https://matplotlib.org/3.2.1/tutorials/introductory/usage.html#backends

from MDAnalysisTests.util import (
block_import,
Expand Down
2 changes: 0 additions & 2 deletions testsuite/MDAnalysisTests/visualization/test_streamlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
from MDAnalysis.coordinates.XTC import XTCWriter
from MDAnalysisTests.datafiles import Martini_membrane_gro
import pytest
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import os

Expand Down

0 comments on commit 34288cc

Please sign in to comment.