Skip to content

Fix potentially buggy calls to "super"#706

Merged
rahulporuri merged 4 commits into
masterfrom
rahulporuri-patch-1
Apr 21, 2021
Merged

Fix potentially buggy calls to "super"#706
rahulporuri merged 4 commits into
masterfrom
rahulporuri-patch-1

Conversation

@rahulporuri
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread chaco/array_plot_data.py Outdated
@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
Comment thread chaco/array_plot_data.py Outdated
Comment thread chaco/base_data_range.py Outdated
@rahulporuri rahulporuri changed the title [WIP] Fix potentially buggy calls to "super" Fix potentially buggy calls to "super" Apr 21, 2021
Copy link
Copy Markdown
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

values = np.arange(4).reshape(2, 2)
self.plot = create_image_plot(values)
super(TestImageInspectorToolGray, self).setUp()
BaseImageInspectorTool.setUp(self)
Copy link
Copy Markdown
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
Copy Markdown
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