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

Skip to content

Commit 026287a

Browse files
committed
Fix broken QApplication init in a test.
1 parent 6d394df commit 026287a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/tests/test_backend_qt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,9 @@ def crashing_callback(fig, stale):
379379

380380
@pytest.mark.backend('Qt5Agg', skip_on_importerror=True)
381381
def test_form_widget_get_with_datetime_and_date_fields():
382-
if not QtWidgets.QApplication.instance():
383-
QtWidgets.QApplication()
382+
from matplotlib.backends.backend_qt import _create_qApp
383+
_create_qApp()
384+
384385
form = [
385386
("Datetime field", datetime(year=2021, month=3, day=11)),
386387
("Date field", date(year=2021, month=3, day=11))

0 commit comments

Comments
 (0)