mirror of
https://github.com/python/cpython.git
synced 2025-10-20 13:43:01 +00:00
parent
41f29e5d16
commit
c33b6fbf35
1 changed files with 4 additions and 0 deletions
|
@ -464,6 +464,10 @@ class BaseBytesTest:
|
||||||
with self.assertRaises(ValueError) as cm:
|
with self.assertRaises(ValueError) as cm:
|
||||||
self.type2test.fromhex(value)
|
self.type2test.fromhex(value)
|
||||||
self.assertIn("fromhex() arg must contain an even number of hexadecimal digits", str(cm.exception))
|
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 (
|
for data, pos in (
|
||||||
# invalid first hexadecimal character
|
# invalid first hexadecimal character
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue