https://github.com/python/cpython/commit/c33b6fbf358c1bc14b20e14a1fffff62c6826ecd
commit: c33b6fbf358c1bc14b20e14a1fffff62c6826ecd
branch: main
author: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
<[email protected]>
committer: hauntsaninja <[email protected]>
date: 2024-12-12T02:18:12Z
summary:
gh-127740: Add some more tests for earlier PR #127756 (#127818)
files:
M Lib/test/test_bytes.py
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 32cd178fa3b445..7bb1ab38aa4fdf 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -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
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]