(self)
| 6936 | self.assertFalse(is_date(arg, exact)) |
| 6937 | |
| 6938 | def test_check_time(self): |
| 6939 | class TimeSubclass(time): |
| 6940 | pass |
| 6941 | |
| 6942 | t = time(12, 30) |
| 6943 | ts = TimeSubclass(12, 30) |
| 6944 | |
| 6945 | is_time = _testcapi.datetime_check_time |
| 6946 | |
| 6947 | # Check the ones that should be valid |
| 6948 | self.assertTrue(is_time(t)) |
| 6949 | self.assertTrue(is_time(ts)) |
| 6950 | self.assertTrue(is_time(t, True)) |
| 6951 | |
| 6952 | # Check that the subclass does not match exactly |
| 6953 | self.assertFalse(is_time(ts, True)) |
| 6954 | |
| 6955 | # Check that various other things are not times |
| 6956 | args = [tuple(), list(), 1, '2011-01-01', |
| 6957 | timedelta(1), timezone.utc, date(2011, 1, 1)] |
| 6958 | |
| 6959 | for arg in args: |
| 6960 | for exact in (True, False): |
| 6961 | with self.subTest(arg=arg, exact=exact): |
| 6962 | self.assertFalse(is_time(arg, exact)) |
| 6963 | |
| 6964 | def test_check_datetime(self): |
| 6965 | class DateTimeSubclass(datetime): |
nothing calls this directly
no test coverage detected