-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-46301: remove refleak from Enum tests
#30510
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
Conversation
|
Looks like the CI failed for some unrelated reasons: I will try to apply |
|
Ok, buildbots take quite a long time to work (1h+). I hope that retriggering a single failing one is not so important. Other Refleak tests pass. So, I don't want to waste extra resources 🙂 |
ethanfurman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the solution.
While it pains me to say it, please fix the formatting.
Lib/test/test_enum.py
Outdated
| # `_convert_` uses a module side effect that does this. See 30472 | ||
| with support.swap_item( | ||
| sys.modules, MODULE, _ModuleWrapper(sys.modules[MODULE]), | ||
| ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use Black formatting on enum code, please. Continuation lines should be eight space indents, and each closing ), ], and } should line up as if it were code and not syntax, with the final line (if it introduces a block) only indented the normal four spaces. In other words:
a_long_list_comprehension = [
x
for x in spam(eggs, ham)
if x not in some_previous_group
]
and
with yada(
arg1, arg2, something_else=None,
):
# body of code
| COMPLEX_A = 2j | ||
| COMPLEX_B = 3j | ||
|
|
||
| class _ModuleWrapper: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this. Please switch over the other _convert_ tests to use it, which will allow the removal of the setUp() methods in those tests.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Done! Code formatting is very important I (as a maintainer of ~10 different linters) can totally relate 😊 Thanks for the review! To make bot happy: I have made the requested changes; please review again |
I think you forgot a period. ;-) |

It does not happen anymore, I've tested this locally using:
PYTHONDUMPREFSFILE=ex.txt ./python.exe -m test -R : -v test_enumRefs #30472
CC @ethanfurman and @pablogsal
And CC @corona10 as my mentor.
https://bugs.python.org/issue46301