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

Skip to content

Commit 4c35465

Browse files
committed
TST: remove un-needed special case
If pyqt4 is imported the code just above will catch the problem and if pyqt4 is not imported we can rely on `plt.switch_backend` to handle the fallback between pyqt/pyside versions.
1 parent 146872d commit 4c35465

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

lib/matplotlib/testing/conftest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ def mpl_test_settings(request):
5353
if backend.lower().startswith('qt5'):
5454
if any(sys.modules.get(k) for k in ('PyQt4', 'PySide')):
5555
pytest.skip('Qt4 binding already imported')
56-
try:
57-
import PyQt5
58-
# RuntimeError if PyQt4 already imported.
59-
except (ImportError, RuntimeError):
60-
try:
61-
import PySide2
62-
except ImportError:
63-
pytest.skip("Failed to import a Qt5 binding.")
6456

6557
# Default of cleanup and image_comparison too.
6658
style = ["classic", "_classic_test_patch"]

0 commit comments

Comments
 (0)