Skip to content

Commit 879994e

Browse files
committed
Add some more tests
1 parent ee7947a commit 879994e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/test/test_bytes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,10 @@ def test_fromhex(self):
460460
self.assertRaises(ValueError, self.type2test.fromhex, '12 \x00 34')
461461

462462
# For odd number of character(s)
463-
with self.assertRaises(ValueError) as cm:
464-
self.type2test.fromhex("a")
465-
self.assertIn("fromhex() arg must be of even length", str(cm.exception))
463+
for value in ("a", "a ", " a"," a ", "aaa", "aaa ", " aaa", " aaa "):
464+
with self.assertRaises(ValueError) as cm:
465+
self.type2test.fromhex(value)
466+
self.assertIn("fromhex() arg must be of even length", str(cm.exception))
466467

467468
for data, pos in (
468469
# invalid first hexadecimal character

0 commit comments

Comments
 (0)