(self)
| 7123 | self.assertFalse(is_date(arg, exact)) |
| 7124 | |
| 7125 | def test_check_time(self): |
| 7126 | class TimeSubclass(time): |
| 7127 | pass |
| 7128 | |
| 7129 | t = time(12, 30) |
| 7130 | ts = TimeSubclass(12, 30) |
| 7131 | |
| 7132 | is_time = _testcapi.datetime_check_time |
| 7133 | |
| 7134 | # Check the ones that should be valid |
| 7135 | self.assertTrue(is_time(t)) |
| 7136 | self.assertTrue(is_time(ts)) |
| 7137 | self.assertTrue(is_time(t, True)) |
| 7138 | |
| 7139 | # Check that the subclass does not match exactly |
| 7140 | self.assertFalse(is_time(ts, True)) |
| 7141 | |
| 7142 | # Check that various other things are not times |
| 7143 | args = [tuple(), list(), 1, '2011-01-01', |
| 7144 | timedelta(1), timezone.utc, date(2011, 1, 1)] |
| 7145 | |
| 7146 | for arg in args: |
| 7147 | for exact in (True, False): |
| 7148 | with self.subTest(arg=arg, exact=exact): |
| 7149 | self.assertFalse(is_time(arg, exact)) |
| 7150 | |
| 7151 | def test_check_datetime(self): |
| 7152 | class DateTimeSubclass(datetime): |
nothing calls this directly
no test coverage detected