Skip to content

Commit 9686b17

Browse files
committed
normalize test order
1 parent e79bf0e commit 9686b17

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Lib/test/datetimetester.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,18 +2079,21 @@ def test_roundtrip(self):
20792079
def test_isoformat(self):
20802080
t = self.theclass(1, 2, 3, 4, 5, 1, 123)
20812081
self.assertEqual(t.isoformat(), "0001-02-03T04:05:01.000123")
2082-
self.assertEqual(t.isoformat('T'), "0001-02-03T04:05:01.000123")
2083-
self.assertEqual(t.isoformat(' '), "0001-02-03 04:05:01.000123")
2084-
self.assertEqual(t.isoformat('\x00'), "0001-02-03\x0004:05:01.000123")
2085-
20862082
self.assertEqual(t.isoformat(basic=True), "00010203T040501.000123")
2083+
2084+
self.assertEqual(t.isoformat('T'), "0001-02-03T04:05:01.000123")
20872085
self.assertEqual(t.isoformat('T', basic=True), "00010203T040501.000123")
2086+
2087+
self.assertEqual(t.isoformat(' '), "0001-02-03 04:05:01.000123")
20882088
self.assertEqual(t.isoformat(' ', basic=True), "00010203 040501.000123")
2089+
2090+
self.assertEqual(t.isoformat('\x00'), "0001-02-03\x0004:05:01.000123")
20892091
self.assertEqual(t.isoformat('\x00', basic=True), "00010203\x00040501.000123")
20902092

20912093
# bpo-34482: Check that surrogates are handled properly.
2092-
self.assertEqual(t.isoformat('\ud800'),
2093-
"0001-02-03\ud80004:05:01.000123")
2094+
self.assertEqual(t.isoformat('\ud800'), "0001-02-03\ud80004:05:01.000123")
2095+
self.assertEqual(t.isoformat('\ud800', basic=True), "00010203\ud800040501.000123")
2096+
20942097
self.assertEqual(t.isoformat(timespec='hours'), "0001-02-03T04")
20952098
self.assertEqual(t.isoformat(timespec='hours', basic=True), "00010203T04")
20962099

@@ -2113,8 +2116,10 @@ def test_isoformat(self):
21132116
self.assertEqual(t.isoformat(sep=' ', timespec='minutes', basic=True), "00010203 0405")
21142117

21152118
self.assertRaises(ValueError, t.isoformat, timespec='foo')
2119+
self.assertRaises(ValueError, t.isoformat, timespec='foo', basic=True)
21162120
# bpo-34482: Check that surrogates are handled properly.
21172121
self.assertRaises(ValueError, t.isoformat, timespec='\ud800')
2122+
self.assertRaises(ValueError, t.isoformat, timespec='\ud800', basic=True)
21182123
# str is ISO format with the separator forced to a blank.
21192124
self.assertEqual(str(t), "0001-02-03 04:05:01.000123")
21202125

0 commit comments

Comments
 (0)