-
-
Notifications
You must be signed in to change notification settings - Fork 292
Fix ImportedModuleTests #1552
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
Fix ImportedModuleTests #1552
Conversation
Pull Request Test Coverage Report for Build 2316558741
π - Coveralls |
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 could conform these to the way Marc did them in #1553, but I think it harms readability.
152b4ca
to
4883d5c
Compare
4883d5c
to
92e312c
Compare
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 switch to pytest style, it's not astroid style for legacy reason but we need to start somewhere if we want good thing π
@@ -6628,38 +6628,60 @@ def test_inference_of_items_on_module_dict() -> None: | |||
builder.file_build(str(DATA_DIR / "module_dict_items_call" / "test.py"), "models") | |||
|
|||
|
|||
class ImportedModuleTests(resources.AstroidCacheSetupMixin): |
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.
Just a note, you don't need to remove test classes. Even with pytest
, they can be helpful to group test cases. I believe the only important things to remember are the classname must begin with Test...
and you can use @staticmethod
if you don't need self
.
Description
Type of Changes
Related Issue
Follow-up to #1399. This needed to subclass
TestCase
to actually run, and that revealed that clearing the cache before each test method was necessary. cc @tristanlatr EDIT: er, better to use new module names, and avoid clearing the cache altogether, since that's not what's being tested.