Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e347200

Browse filesBrowse files
committed
Merge two unit tests into one.
Re #19075
1 parent 7867ce8 commit e347200
Copy full SHA for e347200

File tree

Expand file treeCollapse file tree

1 file changed

+9
-14
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-14
lines changed

‎lib/matplotlib/tests/test_backend_qt.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_qt.py
+9-14Lines changed: 9 additions & 14 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.