Skip to content
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 potentially buggy calls to "super" #706

Merged
merged 4 commits into from
Apr 21, 2021
Merged

Conversation

rahulporuri
Copy link
Contributor

No description provided.

@rahulporuri rahulporuri changed the title [WIP] Fix buggy calls to "super" [WIP] Fix potentially buggy calls to "super" Apr 21, 2021
replace use of super by manually calling setUp with self
on the class the test case inherits from
chaco/array_plot_data.py Outdated Show resolved Hide resolved
chaco/base_data_range.py Outdated Show resolved Hide resolved
@rahulporuri rahulporuri changed the title [WIP] Fix potentially buggy calls to "super" Fix potentially buggy calls to "super" Apr 21, 2021
Copy link
Contributor

@aaronayres35 aaronayres35 left a comment

Choose a reason for hiding this comment

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

LGTM just one question

@@ -83,7 +83,7 @@ class TestImageInspectorToolGray(BaseImageInspectorTool, TestCase):
def setUp(self):
values = np.arange(4).reshape(2, 2)
self.plot = create_image_plot(values)
super(TestImageInspectorToolGray, self).setUp()
BaseImageInspectorTool.setUp(self)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why exactly can't this be super().setUp()? I notice the tests all still pass if that change is made.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we discussed this in person - this is part convention and part best practice afaik - especially because we have a few places where we need to call setUp on more than one baseclass.

@rahulporuri rahulporuri merged commit 39ce09b into master Apr 21, 2021
@rahulporuri rahulporuri deleted the rahulporuri-patch-1 branch April 21, 2021 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants