(self)
| 7201 | self.assertFalse(is_timedelta(arg, exact)) |
| 7202 | |
| 7203 | def test_check_tzinfo(self): |
| 7204 | class TZInfoSubclass(tzinfo): |
| 7205 | pass |
| 7206 | |
| 7207 | tzi = tzinfo() |
| 7208 | tzis = TZInfoSubclass() |
| 7209 | tz = timezone(timedelta(hours=-5)) |
| 7210 | |
| 7211 | is_tzinfo = _testcapi.datetime_check_tzinfo |
| 7212 | |
| 7213 | # Check the ones that should be valid |
| 7214 | self.assertTrue(is_tzinfo(tzi)) |
| 7215 | self.assertTrue(is_tzinfo(tz)) |
| 7216 | self.assertTrue(is_tzinfo(tzis)) |
| 7217 | self.assertTrue(is_tzinfo(tzi, True)) |
| 7218 | |
| 7219 | # Check that the subclasses do not match exactly |
| 7220 | self.assertFalse(is_tzinfo(tz, True)) |
| 7221 | self.assertFalse(is_tzinfo(tzis, True)) |
| 7222 | |
| 7223 | # Check that various other things are not tzinfos |
| 7224 | args = [tuple(), list(), 1, '2011-01-01', |
| 7225 | date(2011, 1, 1), datetime(2011, 1, 1)] |
| 7226 | |
| 7227 | for arg in args: |
| 7228 | for exact in (True, False): |
| 7229 | with self.subTest(arg=arg, exact=exact): |
| 7230 | self.assertFalse(is_tzinfo(arg, exact)) |
| 7231 | |
| 7232 | def test_date_from_date(self): |
| 7233 | exp_date = date(1993, 8, 26) |
nothing calls this directly
no test coverage detected