(self)
| 3076 | with self.assertRaises(ValueError): strptime("z", "%z") |
| 3077 | |
| 3078 | def test_strptime_ampm(self): |
| 3079 | dt = datetime(1999, 3, 17, 0, 44, 55, 2) |
| 3080 | for hour in range(0, 24): |
| 3081 | with self.subTest(hour=hour): |
| 3082 | new_dt = dt.replace(hour=hour) |
| 3083 | dt_str = new_dt.strftime("%I %p") |
| 3084 | |
| 3085 | self.assertEqual(self.theclass.strptime(dt_str, "%I %p").hour, |
| 3086 | hour) |
| 3087 | |
| 3088 | def test_strptime_single_digit(self): |
| 3089 | # bpo-34903: Check that single digit dates and times are allowed. |