Sorry, something went wrong.
| # 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.
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?
Sorry, something went wrong.
There was a problem hiding this comment.
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
When it is made into an assertion, pytest shows:
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?
Sorry, something went wrong.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think this was part of the tutorial. In this PR, I removed @NoEffect everywhere in the tests, not just in lines of code that are included in the generated documentation. (This occurrence was in the submodule tests.)
Sorry, something went wrong.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Fixes #1674
Along with removing all @NoEffect annotations (there were only a handful), this:
There are some other commented @-style suppression annotations throughout the project. This PR deliberately does not touch those. Some of them express useful intent that should eventually be stated in a different way but currently could be a breaking change to express better. For example, some of them express that a name that is imported but not used is intended to be present, which is better expressed with a static __all__ listing exactly the names (imports and otherwise) meant to be accessed through the module, but to usefully express this an __all__ needs to omit names not intended to be accessed that way, which may be a breaking change.