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

Skip to content

Commit 3d8a6cb

Browse files
committed
TST: generalize qt flavor detection in conftest
1 parent 504d629 commit 3d8a6cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/testing/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def mpl_test_settings(request):
4646
prev_backend = matplotlib.get_backend()
4747

4848
# special case Qt backend importing to avoid conflicts
49-
if backend == 'Qt4Agg':
49+
if backend.lower().startswith('qt4'):
5050
if any(k in sys.modules for k in ('PyQt5', 'PySide2')):
5151
pytest.skip('Qt5 binding already imported')
5252
try:
@@ -57,7 +57,7 @@ def mpl_test_settings(request):
5757
import PySide
5858
except ImportError:
5959
pytest.skip("Failed to import a Qt4 binding.")
60-
elif backend == 'Qt5Agg':
60+
elif backend.lower().startswith('qt5'):
6161
if any(k in sys.modules for k in ('PyQt4', 'PySide')):
6262
pytest.skip('Qt4 binding already imported')
6363
try:

0 commit comments

Comments
 (0)