-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Let AstroidManager.clear_cache
act on other caches
#1521
Let AstroidManager.clear_cache
act on other caches
#1521
Conversation
2f28b98
to
35171c4
Compare
for more information, see https://pre-commit.ci
Pull Request Test Coverage Report for Build 2281918404
π - Coveralls |
Manager.clear_cache
to other cachesManager.clear_cache
act on other caches
Co-authored-by: Pierre Sassoulas <[email protected]>
Manager.clear_cache
act on other cachesAstroidManager.clear_cache
act on other caches
result = _NORM_PATH_CACHE[path] = _normalize_path(path) | ||
return result | ||
if not path: # don't cache result for '' | ||
return _normalize_path(path) |
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.
This line is not covered, on the other hand are we really ever having something falsey here ?
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 added coverage. We talked a bit about it here.
@@ -23,8 +23,6 @@ | |||
Union, | |||
) | |||
|
|||
import wrapt |
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 was wondering if we could remove the dependency to wrapt following this change, Turns out that there are other uses elsewhere but not that much.
Ah, another test isolation issue to look into. |
@@ -179,7 +179,7 @@ def test_load_packages_without_init(self) -> None: | |||
https://github.com/PyCQA/astroid/issues/1327 | |||
""" | |||
tmp_dir = Path(tempfile.gettempdir()) | |||
self.addCleanup(os.chdir, os.curdir) | |||
self.addCleanup(os.chdir, os.getcwd()) |
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.
We need to actually find the cwd before changing dir, otherwise this cleanup won't do anything.
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.
π
Description
Alternative to #1242. See #1242 (review)
Type of Changes
Related Issue
Resolves #792 (but let's get a benchmark and find out)