(self)
| 253 | ) |
| 254 | |
| 255 | def test_S_format(self): |
| 256 | for expected, days in [ |
| 257 | ("st", [1, 21, 31]), |
| 258 | ("nd", [2, 22]), |
| 259 | ("rd", [3, 23]), |
| 260 | ("th", (n for n in range(4, 31) if n not in [21, 22, 23])), |
| 261 | ]: |
| 262 | for day in days: |
| 263 | dt = date(1970, 1, day) |
| 264 | with self.subTest(day=day): |
| 265 | self.assertEqual(dateformat.format(dt, "S"), expected) |
| 266 | |
| 267 | def test_y_format_year_before_1000(self): |
| 268 | tests = [ |