Skip to content

Commit

Permalink
gh-127740: Add some more tests for earlier PR #127756 (#127818)
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy authored Dec 12, 2024
1 parent 41f29e5 commit c33b6fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/test_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ def test_fromhex(self):
with self.assertRaises(ValueError) as cm:
self.type2test.fromhex(value)
self.assertIn("fromhex() arg must contain an even number of hexadecimal digits", str(cm.exception))
for value, position in (("a ", 1), (" aa a ", 5), (" aa a a ", 5)):
with self.assertRaises(ValueError) as cm:
self.type2test.fromhex(value)
self.assertIn(f"non-hexadecimal number found in fromhex() arg at position {position}", str(cm.exception))

for data, pos in (
# invalid first hexadecimal character
Expand Down

0 comments on commit c33b6fb

Please sign in to comment.