From d13061c0b017423843137603ec1d8e7f43c427a1 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 15 Apr 2021 08:03:51 -0700 Subject: [PATCH 1/2] skip test failing on windows/pyqt --- chaco/tests/test_plot.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/chaco/tests/test_plot.py b/chaco/tests/test_plot.py index 3b82ff028..18552f321 100644 --- a/chaco/tests/test_plot.py +++ b/chaco/tests/test_plot.py @@ -1,3 +1,4 @@ +import platform import unittest from numpy import alltrue, arange, array @@ -13,6 +14,17 @@ from chaco.default_colormaps import viridis from chaco.tools.api import PanTool, ZoomTool +is_windows = platform.system() == "Windows" + +def is_qt4(): + if not ETSConfig.toolkit.startswith('qt'): + return False + + # Only AFTER confirming Qt's availability... + # We lean on Pyface here since the check is complicated. + import pyface.qt + return pyface.qt.is_qt4 + class PlotTestCase(unittest.TestCase): def test_plot_from_unsupported_array_shape(self): @@ -123,6 +135,7 @@ def _plot_default(self): @unittest.skipIf(ETSConfig.toolkit == "null", "Skip on 'null' toolkit") class TestEmptyPlot(unittest.TestCase, EnableTestAssistant): + @unittest.skipIf(is_windows and is_qt4(), "Test breaks on windows/pyqt") def test_dont_crash_on_click(self): from traitsui.testing.api import UITester tester = UITester() From 22479d3b1f968ffc5db214e670d5f5f9f07132f9 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 15 Apr 2021 08:07:20 -0700 Subject: [PATCH 2/2] flake8 --- chaco/tests/test_plot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/chaco/tests/test_plot.py b/chaco/tests/test_plot.py index 18552f321..abe8e66d2 100644 --- a/chaco/tests/test_plot.py +++ b/chaco/tests/test_plot.py @@ -16,6 +16,7 @@ is_windows = platform.system() == "Windows" + def is_qt4(): if not ETSConfig.toolkit.startswith('qt'): return False