mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[Enum] Remove unused code from test_enum.py
(GH-96986)
This commit is contained in:
parent
97e7004cfe
commit
889b0b9bf9
1 changed files with 0 additions and 14 deletions
|
@ -4553,11 +4553,6 @@ COMPLEX_C = 1j
|
||||||
COMPLEX_A = 2j
|
COMPLEX_A = 2j
|
||||||
COMPLEX_B = 3j
|
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):
|
class TestConvert(unittest.TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
# Reset the module-level test variables to their original integer
|
# Reset the module-level test variables to their original integer
|
||||||
|
@ -4597,12 +4592,6 @@ class TestConvert(unittest.TestCase):
|
||||||
self.assertEqual(test_type.CONVERT_TEST_NAME_D, 5)
|
self.assertEqual(test_type.CONVERT_TEST_NAME_D, 5)
|
||||||
self.assertEqual(test_type.CONVERT_TEST_NAME_E, 5)
|
self.assertEqual(test_type.CONVERT_TEST_NAME_E, 5)
|
||||||
# Ensure that test_type only picked up names matching the filter.
|
# 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)]
|
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)]
|
missing = [name for name in enum_dir(test_type) if name not in dir(test_type)]
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
@ -4644,7 +4633,6 @@ class TestConvert(unittest.TestCase):
|
||||||
self.assertEqual(test_type.CONVERT_STR_TEST_1, 'hello')
|
self.assertEqual(test_type.CONVERT_STR_TEST_1, 'hello')
|
||||||
self.assertEqual(test_type.CONVERT_STR_TEST_2, 'goodbye')
|
self.assertEqual(test_type.CONVERT_STR_TEST_2, 'goodbye')
|
||||||
# Ensure that test_type only picked up names matching the filter.
|
# 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)]
|
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)]
|
missing = [name for name in enum_dir(test_type) if name not in dir(test_type)]
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
@ -4712,8 +4700,6 @@ def member_dir(member):
|
||||||
allowed.add(name)
|
allowed.add(name)
|
||||||
return sorted(allowed)
|
return sorted(allowed)
|
||||||
|
|
||||||
missing = object()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue