Skip to content

gh-109774: Remove duplicated tests from test_enum #109775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 23, 2023

@ethanfurman
Copy link
Member

This PR is unnecessary, as the duplicates are intentional -- they are needed to excercise different creation code paths.

@sobolevn
Copy link
Member Author

@ethanfurman can you please elaborate?

the duplicates are intentional -- they are needed to excercise different creation code paths

class TestPlainEnumClass(_EnumTests, _PlainOutputTests, unittest.TestCase):
    enum_type = Enum

class TestPlainEnumFunction(_EnumTests, _PlainOutputTests, unittest.TestCase):
    enum_type = Enum

These two classes are basically the same: the same enum_type, the same base classes.
There's no indirection in test code as well.

How does it help?

@sobolevn
Copy link
Member Author

Oh, I see: f self.__class__.__name__[-5:] == 'Class':
It is hard to grep this part :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants