Skip to content

Commit

Permalink
pythongh-127740: Add some more tests for earlier PR python#127756
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy committed Dec 11, 2024
1 parent db9bea0 commit 3a75c74
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}", str(cm.exception))

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

0 comments on commit 3a75c74

Please sign in to comment.