Skip to content

Commit e347200

Browse files
committed
Merge two unit tests into one.
Re #19075
1 parent 7867ce8 commit e347200

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

lib/matplotlib/tests/test_backend_qt.py

+9-14
Original file line numberDiff line numberDiff line change
@@ -301,22 +301,17 @@ def crashing_callback(fig, stale):
301301

302302

303303
@pytest.mark.backend('Qt5Agg', skip_on_importerror=True)
304-
def test_form_widget_get_with_datetime_field():
304+
def test_form_widget_get_with_datetime_and_date_fields():
305305
if not QtWidgets.QApplication.instance():
306306
QtWidgets.QApplication()
307-
form = [("Field name", datetime(year=2021, month=3, day=11))]
308-
widget = _formlayout.FormWidget(form)
309-
widget.setup()
310-
values = widget.get()
311-
assert(values == [datetime(year=2021, month=3, day=11)])
312-
313-
314-
@pytest.mark.backend('Qt5Agg', skip_on_importerror=True)
315-
def test_form_widget_get_with_date_field():
316-
if not QtWidgets.QApplication.instance():
317-
QtWidgets.QApplication()
318-
form = [("Field name", date(year=2021, month=3, day=11))]
307+
form = [
308+
("Datetime field", datetime(year=2021, month=3, day=11)),
309+
("Date field", date(year=2021, month=3, day=11))
310+
]
319311
widget = _formlayout.FormWidget(form)
320312
widget.setup()
321313
values = widget.get()
322-
assert(values == [date(year=2021, month=3, day=11)])
314+
assert values == [
315+
datetime(year=2021, month=3, day=11),
316+
date(year=2021, month=3, day=11)
317+
]

0 commit comments

Comments
 (0)