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

Tests: Ensure Bubble uses it's superclass's valid private API #7203

Merged
merged 4 commits into from
Nov 7, 2020

Conversation

gottadiveintopython
Copy link
Member

@gottadiveintopython gottadiveintopython commented Nov 6, 2020

Maintainer merge checklist

  • Title is descriptive/clear for inclusion in release notes.
  • Applied a Component: xxx label.
  • Applied the api-deprecation or api-break label.
  • Applied the release-highlight label to be highlighted in release notes.
  • Added to the milestone version it was merged into.
  • Unittests are included in PR.
  • Properly documented, including versionadded, versionchanged as needed.

Problem

Bubble currently overwrites some of GridLayout's internal properties: _fills_row_first, _fills_from_left_to_right and _fills_from_top_to_bottom. If any of them are renamed/removed, Bubble's should be renamed/removed as well. The problem is that the unittests don't say anything about this. So if someone only modifies GridLayout's, and forgot to modify Bubble's, Bubble might silently get broken.

What this PR does

This PR lets the unittests check if those properties actually exist in Bubble's super classes.
(I feel like there is a better way to solve the problem, so I put "WIP" in the title.)

@gottadiveintopython gottadiveintopython added the Component: Widgets kivy/uix, style.kv label Nov 6, 2020
kivy/tests/test_uix_bubble.py Outdated Show resolved Hide resolved
matham
matham previously approved these changes Nov 7, 2020
@matham matham added this to the 2.0.0 milestone Nov 7, 2020
@gottadiveintopython gottadiveintopython changed the title [WIP] make sure the Bubble overwrites a certain properties make sure the Bubble overwrites a certain properties Nov 7, 2020
@matham matham added Component: tests/CI Tests, CI, GitHub settings and removed Component: Widgets kivy/uix, style.kv labels Nov 7, 2020
@matham matham changed the title make sure the Bubble overwrites a certain properties Tests: Ensure Bubble uses it's superclass's valid private API Nov 7, 2020
@matham matham merged commit 1a7cd9c into kivy:master Nov 7, 2020
@gottadiveintopython
Copy link
Member Author

gottadiveintopython commented Nov 9, 2020

It may be too late, but I guess you think issubclass(Bubble, GridLayout) is unnecessary because we'll never replace the superclass with another, as it breaks the api. If so, yes, you may be right.

Also, I'll fix the error on unittest soon. (test_animation.py)

@matham
Copy link
Member

matham commented Nov 9, 2020

we'll never replace the superclass with another, as it breaks the api.

Exactly.

Also, I'll fix the error on unittest soon. (test_animation.py)

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: tests/CI Tests, CI, GitHub settings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants