From 026287a3dc3725c66d4d1b1f18084dcf5fe984f0 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 24 Aug 2021 05:03:15 -0400 Subject: [PATCH] Fix broken QApplication init in a test. --- lib/matplotlib/tests/test_backend_qt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_qt.py b/lib/matplotlib/tests/test_backend_qt.py index b7fb708bee45..ff104fcfbe83 100644 --- a/lib/matplotlib/tests/test_backend_qt.py +++ b/lib/matplotlib/tests/test_backend_qt.py @@ -379,8 +379,9 @@ def crashing_callback(fig, stale): @pytest.mark.backend('Qt5Agg', skip_on_importerror=True) def test_form_widget_get_with_datetime_and_date_fields(): - if not QtWidgets.QApplication.instance(): - QtWidgets.QApplication() + from matplotlib.backends.backend_qt import _create_qApp + _create_qApp() + form = [ ("Datetime field", datetime(year=2021, month=3, day=11)), ("Date field", date(year=2021, month=3, day=11))