Skip to content

Commit ef02fd4

Browse files
authored
Revert "bpo-46301: [Enum] test uncomparable values in _convert_ (GH-30472)"
This reverts commit 8d59d25.
1 parent d24cd49 commit ef02fd4

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

Lib/test/test_enum.py

-35
Original file line numberDiff line numberDiff line change
@@ -4440,15 +4440,6 @@ def test__all__(self):
44404440
CONVERT_STRING_TEST_NAME_E = 5
44414441
CONVERT_STRING_TEST_NAME_F = 5
44424442

4443-
# We also need values that cannot be compared:
4444-
UNCOMPARABLE_A = 5
4445-
UNCOMPARABLE_C = (9, 1) # naming order is broken on purpose
4446-
UNCOMPARABLE_B = 'value'
4447-
4448-
COMPLEX_C = 1j
4449-
COMPLEX_A = 2j
4450-
COMPLEX_B = 3j
4451-
44524443
class TestIntEnumConvert(unittest.TestCase):
44534444
def setUp(self):
44544445
# Reset the module-level test variables to their original integer
@@ -4486,32 +4477,6 @@ def test_convert(self):
44864477
and name not in dir(IntEnum)],
44874478
[], msg='Names other than CONVERT_TEST_* found.')
44884479

4489-
def test_convert_uncomparable(self):
4490-
uncomp = enum.Enum._convert_(
4491-
'Uncomparable',
4492-
MODULE,
4493-
filter=lambda x: x.startswith('UNCOMPARABLE_'),
4494-
)
4495-
4496-
# Should be ordered by `name` only:
4497-
self.assertEqual(
4498-
list(uncomp),
4499-
[uncomp.UNCOMPARABLE_A, uncomp.UNCOMPARABLE_B, uncomp.UNCOMPARABLE_C],
4500-
)
4501-
4502-
def test_convert_complex(self):
4503-
uncomp = enum.Enum._convert_(
4504-
'Uncomparable',
4505-
MODULE,
4506-
filter=lambda x: x.startswith('COMPLEX_'),
4507-
)
4508-
4509-
# Should be ordered by `name` only:
4510-
self.assertEqual(
4511-
list(uncomp),
4512-
[uncomp.COMPLEX_A, uncomp.COMPLEX_B, uncomp.COMPLEX_C],
4513-
)
4514-
45154480
@unittest.skipUnless(python_version == (3, 8),
45164481
'_convert was deprecated in 3.8')
45174482
def test_convert_warn(self):

0 commit comments

Comments
 (0)