Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-103247: addtearDown totest_loader and clear module cache#104226

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brettcannon merged 3 commits intopython:mainfromsunmy2019:gh-103247
May 10, 2023

Conversation

sunmy2019
Copy link
Member

@sunmy2019sunmy2019 commentedMay 6, 2023
edited by bedevere-bot
Loading

@bedevere-botbedevere-bot added testsTests in the Lib/test dir awaiting review labelsMay 6, 2023
@arhadthedevarhadthedev changed the titlegh-103247: addtearDown and clear module cachegh-103247: addtearDown totest_loader and clear module cacheMay 6, 2023
@itamaro
Copy link
Contributor

I was able to repro the reported failure on main, and confirmed this PR fixes it.

I'm not sure adding thetearDown is helpful though.
theuncache context manager uncaches the names both on enter and exit, and perform some checks on the names - two things that thetearDown doesn't perform.
while having thetearDown may prevent some failures (like this one), its existence might indicate that theuncache context manager is not really needed, which is not necessarily true (I don't know if it matters in practice, just noting the behavior differences).

in any case, I also confirmed that just adding the context manager totest_try_registration without thetearDown fixes the issue.

@sunmy2019
Copy link
MemberAuthor

I'm not sure adding thetearDown is helpful though.

Adding this is proposed by@FFY00. And I am neutral about it.

@sunmy2019
Copy link
MemberAuthor

sunmy2019 commentedMay 7, 2023
edited
Loading

I'm not sure adding thetearDown is helpful though.

I think you are correct, adding both is unnecessary.

tearDown method andutil.uncache provides duplicate function. Andutil.uncache(name) provides more flexibility than thetearDown method.

tearDown here is a safety net. But do we want to expose the problem early or make the system more robust?

I prefer the former since it's a test case. Thus, I will remove this safe net for now.

itamaro reacted with thumbs up emoji

Copy link
Contributor

@itamaroitamaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM!

@brettcannonbrettcannonenabled auto-merge (squash)May 10, 2023 00:35
@brettcannonbrettcannon merged commit22f3425 intopython:mainMay 10, 2023
@miss-islington
Copy link
Contributor

Thanks@sunmy2019 for the PR, and@brettcannon for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

sunmy2019 reacted with thumbs up emoji

@bedevere-bot
Copy link

GH-104345 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelMay 10, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 10, 2023
…xtensions/test_loader.py (pythonGH-104226)(cherry picked from commit22f3425)Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
@sunmy2019sunmy2019 deleted the gh-103247 branchMay 10, 2023 03:40
JelleZijlstra pushed a commit that referenced this pull requestMay 10, 2023
…extensions/test_loader.py (GH-104226) (#104345)gh-103247: clear the module cache in a test in test_importlib/extensions/test_loader.py (GH-104226)(cherry picked from commit22f3425)Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
carljm added a commit to carljm/cpython that referenced this pull requestMay 10, 2023
* main:pythonGH-102181: Improve specialization stats for SEND (pythonGH-102182)pythongh-103000: Optimise `dataclasses.asdict` for the common case (python#104364)pythongh-103538: Remove unused TK_AQUA code (pythonGH-103539)pythonGH-87695: Fix OSError from `pathlib.Path.glob()` (pythonGH-104292)pythongh-104263: Rely on Py_NAN and introduce Py_INFINITY (pythonGH-104202)pythongh-104010: Separate and improve docs for `typing.get_origin` and `typing.get_args` (python#104013)pythongh-101819: Adapt _io._BufferedIOBase_Type methods to Argument Clinic (python#104355)pythongh-103960: Dark mode: invert image brightness (python#103983)pythongh-104252: Immortalize Py_EMPTY_KEYS (pythongh-104253)pythongh-101819: Clean up _io windows console io afterpythongh-104197 (python#104354)pythongh-101819: Harden _io init (python#104352)pythongh-103247: clear the module cache in a test in test_importlib/extensions/test_loader.py (pythonGH-104226)pythongh-103848: Adds checks to ensure that bracketed hosts found by urlsplit are of IPv6 or IPvFuture format (python#103849)pythongh-74895: adjust tests to work on Solaris (python#104326)pythongh-101819: Refactor _io in preparation for module isolation (python#104334)pythongh-90953: Don't use deprecated AST nodes in clinic.py (python#104322)pythongh-102327: Extend docs for "url" and "headers" parameters to HTTPConnection.request()pythongh-104328: Fix typo in ``typing.Generic`` multiple inheritance error message (python#104335)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@brettcannonbrettcannonbrettcannon approved these changes

@itamaroitamaroitamaro approved these changes

@encukouencukouAwaiting requested review from encukou

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@ncoghlanncoghlanAwaiting requested review from ncoghlanncoghlan is a code owner

@warsawwarsawAwaiting requested review from warsawwarsaw is a code owner

@FFY00FFY00Awaiting requested review from FFY00

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@sunmy2019@itamaro@miss-islington@bedevere-bot@brettcannon@arhadthedev

[8]ページ先頭

©2009-2025 Movatter.jp