mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-34443: Use __qualname__ instead of __name__ in enum exception messages. (GH-14809)
* Use __qualname__ instead of __name__ in enum exception messages.
This commit is contained in:
parent
af2f5b1723
commit
323842c279
3 changed files with 13 additions and 10 deletions
|
@ -2260,12 +2260,13 @@ class TestFlag(unittest.TestCase):
|
|||
d = 4
|
||||
f = 6
|
||||
# Bizarre.c | Bizarre.d
|
||||
self.assertRaisesRegex(ValueError, "5 is not a valid Bizarre", Bizarre, 5)
|
||||
self.assertRaisesRegex(ValueError, "5 is not a valid Bizarre", Bizarre, 5)
|
||||
self.assertRaisesRegex(ValueError, "2 is not a valid Bizarre", Bizarre, 2)
|
||||
self.assertRaisesRegex(ValueError, "2 is not a valid Bizarre", Bizarre, 2)
|
||||
self.assertRaisesRegex(ValueError, "1 is not a valid Bizarre", Bizarre, 1)
|
||||
self.assertRaisesRegex(ValueError, "1 is not a valid Bizarre", Bizarre, 1)
|
||||
name = "TestFlag.test_cascading_failure.<locals>.Bizarre"
|
||||
self.assertRaisesRegex(ValueError, "5 is not a valid " + name, Bizarre, 5)
|
||||
self.assertRaisesRegex(ValueError, "5 is not a valid " + name, Bizarre, 5)
|
||||
self.assertRaisesRegex(ValueError, "2 is not a valid " + name, Bizarre, 2)
|
||||
self.assertRaisesRegex(ValueError, "2 is not a valid " + name, Bizarre, 2)
|
||||
self.assertRaisesRegex(ValueError, "1 is not a valid " + name, Bizarre, 1)
|
||||
self.assertRaisesRegex(ValueError, "1 is not a valid " + name, Bizarre, 1)
|
||||
|
||||
def test_duplicate_auto(self):
|
||||
class Dupes(Enum):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue