-
-
Notifications
You must be signed in to change notification settings - Fork 953
Remove @NoEffect
annotations
#1677
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
@NoEffect
annotations
+ Add missing asserts, where an expression statement was by itself that was intended as an assertion. This turned out to be the case in the places `@NoEffect` appeared in rendered documentation, making it so no per-file-ignores or other broadened suppressions were needed. + Fix misspellings (including one case affecting documentation). + Add a FIXME comment for investigating a free-standing expression statement with no obvious side effects that may have been meant as an assertion but would fail if turned into one.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,7 @@ def _do_base_tests(self, rwrepo): | |
|
||
# force it to reread its information | ||
del smold._url | ||
smold.url == sm.url # noqa: B015 # @NoEffect | ||
smold.url == sm.url # noqa: B015 # FIXME: Should this be an assertion? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If made into an assertion it would fail, I wonder if this means that there is a bug in the submodule implementation or the assertion is simply wrong to begin with. Maybe it's an assertion that doesn't work similarly on all platforms? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not fully clear on what is expected to happen. In context, we have: GitPython/test/test_submodule.py Lines 107 to 114 in b27a89f
# some commits earlier we still have a submodule, but its at a different commit
smold = next(Submodule.iter_items(rwrepo, self.k_subm_changed))
assert smold.binsha != sm.binsha
assert smold != sm # the name changed
# force it to reread its information
del smold._url
smold.url == sm.url # noqa: B015 # FIXME: Should this be an assertion?
When it is made into an assertion,
Is the different remote URL part of what this intends to test? Or is this something that broke at some point (or would have broken, if it were an assertion) as a result of moving the remote to GitHub? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's surprising to see a gitorious URL there - where would that be coming from? When looking at this confused, I'd think it's definitely not suitable as tutorial of any kind. Maybe it's better to either revamp it into something more useful, or remove it entirely. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this was part of the tutorial. In this PR, I removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, thanks for the clarification, I should have known by looking at the filename in the provided code excerpt. Since it's already a FIXME, I presume that when trying to improve the GitPython package layout and maybe make submodule tests independent of their containing repository, this will naturally be resolved. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think making the tests independent would entail fixing it. Whether or not improving the package layout would depends in more details of how that is done. It could also probably be fixed directly, but this would require figuring out where that old URL came from and what, exactly, the bounds are of what the test intends (or should intend) to test. |
||
|
||
# test config_reader/writer methods | ||
sm.config_reader() | ||
|