diff options
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r-- | Lib/test/datetimetester.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 5800487..b440e5a 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -3324,16 +3324,25 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase): def test_compat_unpickle(self): tests = [ - b"cdatetime\ntime\n(S'\\x14;\\x10\\x00\\x10\\x00'\ntR.", - b'cdatetime\ntime\n(U\x06\x14;\x10\x00\x10\x00tR.', - b'\x80\x02cdatetime\ntime\nU\x06\x14;\x10\x00\x10\x00\x85R.', + (b"cdatetime\ntime\n(S'\\x14;\\x10\\x00\\x10\\x00'\ntR.", + (20, 59, 16, 64**2)), + (b'cdatetime\ntime\n(U\x06\x14;\x10\x00\x10\x00tR.', + (20, 59, 16, 64**2)), + (b'\x80\x02cdatetime\ntime\nU\x06\x14;\x10\x00\x10\x00\x85R.', + (20, 59, 16, 64**2)), + (b"cdatetime\ntime\n(S'\\x14;\\x19\\x00\\x10\\x00'\ntR.", + (20, 59, 25, 64**2)), + (b'cdatetime\ntime\n(U\x06\x14;\x19\x00\x10\x00tR.', + (20, 59, 25, 64**2)), + (b'\x80\x02cdatetime\ntime\nU\x06\x14;\x19\x00\x10\x00\x85R.', + (20, 59, 25, 64**2)), ] - args = 20, 59, 16, 64**2 - expected = self.theclass(*args) - for data in tests: - for loads in pickle_loads: - derived = loads(data, encoding='latin1') - self.assertEqual(derived, expected) + for i, (data, args) in enumerate(tests): + with self.subTest(i=i): + expected = self.theclass(*args) + for loads in pickle_loads: + derived = loads(data, encoding='latin1') + self.assertEqual(derived, expected) def test_bool(self): # time is always True. |