summaryrefslogtreecommitdiff
path: root/Lib/test/test_enum.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2019-07-18 20:37:13 +0200
committerEthan Furman <ethan@stoneleaf.us>2019-07-18 11:37:13 -0700
commit323842c2792a81e87917790506ec3457832c84b3 (patch)
treeded0113edade7ad0aff9373f1cff4a0ab25254e3 /Lib/test/test_enum.py
parentaf2f5b1723b95e45e1f15b5bd52102b7de560f7c (diff)
downloadcpython-git-323842c2792a81e87917790506ec3457832c84b3.tar.gz
bpo-34443: Use __qualname__ instead of __name__ in enum exception messages. (GH-14809)
* Use __qualname__ instead of __name__ in enum exception messages.
Diffstat (limited to 'Lib/test/test_enum.py')
-rw-r--r--Lib/test/test_enum.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index fcfa7d923e..7bccd6660b 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -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):