(self)
| 7014 | self.assertFalse(is_timedelta(arg, exact)) |
| 7015 | |
| 7016 | def test_check_tzinfo(self): |
| 7017 | class TZInfoSubclass(tzinfo): |
| 7018 | pass |
| 7019 | |
| 7020 | tzi = tzinfo() |
| 7021 | tzis = TZInfoSubclass() |
| 7022 | tz = timezone(timedelta(hours=-5)) |
| 7023 | |
| 7024 | is_tzinfo = _testcapi.datetime_check_tzinfo |
| 7025 | |
| 7026 | # Check the ones that should be valid |
| 7027 | self.assertTrue(is_tzinfo(tzi)) |
| 7028 | self.assertTrue(is_tzinfo(tz)) |
| 7029 | self.assertTrue(is_tzinfo(tzis)) |
| 7030 | self.assertTrue(is_tzinfo(tzi, True)) |
| 7031 | |
| 7032 | # Check that the subclasses do not match exactly |
| 7033 | self.assertFalse(is_tzinfo(tz, True)) |
| 7034 | self.assertFalse(is_tzinfo(tzis, True)) |
| 7035 | |
| 7036 | # Check that various other things are not tzinfos |
| 7037 | args = [tuple(), list(), 1, '2011-01-01', |
| 7038 | date(2011, 1, 1), datetime(2011, 1, 1)] |
| 7039 | |
| 7040 | for arg in args: |
| 7041 | for exact in (True, False): |
| 7042 | with self.subTest(arg=arg, exact=exact): |
| 7043 | self.assertFalse(is_tzinfo(arg, exact)) |
| 7044 | |
| 7045 | def test_date_from_date(self): |
| 7046 | exp_date = date(1993, 8, 26) |
nothing calls this directly
no test coverage detected