(self)
| 5398 | self.assertRaises(TypeError, meth, tzinfo=off42) |
| 5399 | |
| 5400 | def test_tzinfo_utcfromtimestamp(self): |
| 5401 | import time |
| 5402 | meth = self.theclass.utcfromtimestamp |
| 5403 | ts = time.time() |
| 5404 | # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up). |
| 5405 | with self.assertWarns(DeprecationWarning): |
| 5406 | base = meth(ts) |
| 5407 | # Try with and without naming the keyword; for whatever reason, |
| 5408 | # utcfromtimestamp() doesn't accept a tzinfo argument. |
| 5409 | off42 = FixedOffset(42, "42") |
| 5410 | with warnings.catch_warnings(category=DeprecationWarning): |
| 5411 | warnings.simplefilter("ignore", category=DeprecationWarning) |
| 5412 | self.assertRaises(TypeError, meth, ts, off42) |
| 5413 | self.assertRaises(TypeError, meth, ts, tzinfo=off42) |
| 5414 | |
| 5415 | def test_tzinfo_timetuple(self): |
| 5416 | # TestDateTime tested most of this. datetime adds a twist to the |
nothing calls this directly
no test coverage detected