Skip to content

Commit b3e831d

Browse files
committed
Add datetime.* type checks, as @CAM-Gerlach suggested
1 parent 6ee0931 commit b3e831d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

qtpy/tests/test_qtcore.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Test QtCore."""
22

33
import sys
4-
from datetime import datetime
4+
from datetime import date, datetime, time
55

66
import pytest
77

@@ -31,6 +31,7 @@ def test_QDateTime_toPython_and_toPyDateTime(method):
3131
"""Test `QDateTime.toPython` and `QDateTime.toPyDateTime`"""
3232
q_datetime = QtCore.QDateTime(NOW)
3333
py_datetime = getattr(q_datetime, method)()
34+
assert isinstance(py_datetime, datetime)
3435
assert py_datetime == NOW
3536

3637

@@ -39,6 +40,7 @@ def test_QDate_toPython_and_toPyDate(method):
3940
"""Test `QDate.toPython` and `QDate.toPyDate`"""
4041
q_date = QtCore.QDateTime(NOW).date()
4142
py_date = getattr(q_date, method)()
43+
assert isinstance(py_date, date)
4244
assert py_date == NOW.date()
4345

4446

@@ -47,6 +49,7 @@ def test_QTime_toPython_and_toPyTime(method):
4749
"""Test `QTime.toPython` and `QTime.toPyTime`"""
4850
q_time = QtCore.QDateTime(NOW).time()
4951
py_time = getattr(q_time, method)()
52+
assert isinstance(py_time, time)
5053
assert py_time == NOW.time()
5154

5255

0 commit comments

Comments
 (0)