Skip to content

Commit

Permalink
[Enum] Remove unused code from test_enum.py (GH-96986)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Dec 7, 2022
1 parent 97e7004 commit 889b0b9
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions Lib/test/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -4553,11 +4553,6 @@ class Quadruple(Enum):
COMPLEX_A = 2j
COMPLEX_B = 3j

class _ModuleWrapper:
"""We use this class as a namespace for swapping modules."""
def __init__(self, module):
self.__dict__.update(module.__dict__)

class TestConvert(unittest.TestCase):
def tearDown(self):
# Reset the module-level test variables to their original integer
Expand Down Expand Up @@ -4597,12 +4592,6 @@ def test_convert_int(self):
self.assertEqual(test_type.CONVERT_TEST_NAME_D, 5)
self.assertEqual(test_type.CONVERT_TEST_NAME_E, 5)
# Ensure that test_type only picked up names matching the filter.
int_dir = dir(int) + [
'CONVERT_TEST_NAME_A', 'CONVERT_TEST_NAME_B', 'CONVERT_TEST_NAME_C',
'CONVERT_TEST_NAME_D', 'CONVERT_TEST_NAME_E', 'CONVERT_TEST_NAME_F',
'CONVERT_TEST_SIGABRT', 'CONVERT_TEST_SIGIOT',
'CONVERT_TEST_EIO', 'CONVERT_TEST_EBUS',
]
extra = [name for name in dir(test_type) if name not in enum_dir(test_type)]
missing = [name for name in enum_dir(test_type) if name not in dir(test_type)]
self.assertEqual(
Expand Down Expand Up @@ -4644,7 +4633,6 @@ def test_convert_str(self):
self.assertEqual(test_type.CONVERT_STR_TEST_1, 'hello')
self.assertEqual(test_type.CONVERT_STR_TEST_2, 'goodbye')
# Ensure that test_type only picked up names matching the filter.
str_dir = dir(str) + ['CONVERT_STR_TEST_1', 'CONVERT_STR_TEST_2']
extra = [name for name in dir(test_type) if name not in enum_dir(test_type)]
missing = [name for name in enum_dir(test_type) if name not in dir(test_type)]
self.assertEqual(
Expand Down Expand Up @@ -4712,8 +4700,6 @@ def member_dir(member):
allowed.add(name)
return sorted(allowed)

missing = object()


if __name__ == '__main__':
unittest.main()

0 comments on commit 889b0b9

Please sign in to comment.