summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2022-01-09 20:07:03 -0800
committerGitHub <noreply@github.com>2022-01-09 20:07:03 -0800
commitef02fd4e1233cdf79ee32bfcd140d082b989fada (patch)
treef55ab73c64b1bcd2750e6dd5a1a0b205ed084b7e
parentd24cd49acb25c36db31893b84d0ca4fe2f373b94 (diff)
downloadcpython-git-revert-30472-issue-46301.tar.gz
Revert "bpo-46301: [Enum] test uncomparable values in `_convert_` (GH-30472)"revert-30472-issue-46301
This reverts commit 8d59d2563b914b7208779834895c080c70cd94dd.
-rw-r--r--Lib/test/test_enum.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 7e919fb9b4..2b3eac5686 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -4440,15 +4440,6 @@ CONVERT_STRING_TEST_NAME_A = 5 # This one should sort first.
CONVERT_STRING_TEST_NAME_E = 5
CONVERT_STRING_TEST_NAME_F = 5
-# We also need values that cannot be compared:
-UNCOMPARABLE_A = 5
-UNCOMPARABLE_C = (9, 1) # naming order is broken on purpose
-UNCOMPARABLE_B = 'value'
-
-COMPLEX_C = 1j
-COMPLEX_A = 2j
-COMPLEX_B = 3j
-
class TestIntEnumConvert(unittest.TestCase):
def setUp(self):
# Reset the module-level test variables to their original integer
@@ -4486,32 +4477,6 @@ class TestIntEnumConvert(unittest.TestCase):
and name not in dir(IntEnum)],
[], msg='Names other than CONVERT_TEST_* found.')
- def test_convert_uncomparable(self):
- uncomp = enum.Enum._convert_(
- 'Uncomparable',
- MODULE,
- filter=lambda x: x.startswith('UNCOMPARABLE_'),
- )
-
- # Should be ordered by `name` only:
- self.assertEqual(
- list(uncomp),
- [uncomp.UNCOMPARABLE_A, uncomp.UNCOMPARABLE_B, uncomp.UNCOMPARABLE_C],
- )
-
- def test_convert_complex(self):
- uncomp = enum.Enum._convert_(
- 'Uncomparable',
- MODULE,
- filter=lambda x: x.startswith('COMPLEX_'),
- )
-
- # Should be ordered by `name` only:
- self.assertEqual(
- list(uncomp),
- [uncomp.COMPLEX_A, uncomp.COMPLEX_B, uncomp.COMPLEX_C],
- )
-
@unittest.skipUnless(python_version == (3, 8),
'_convert was deprecated in 3.8')
def test_convert_warn(self):