Fix return value and type signature of shell_completion.add_completion_class function#2421
Conversation
0131aeb to
eda387a
Compare
|
Pre-commit check failures seem to concern pre-existing issues. |
|
Hi @davidism. Is this okay for you? |
|
Hey @alexreg , thanks for the PR. While this PR is pretty straight-forward, you didn't include any tests to verify it. |
5a890b2 to
2da801a
Compare
bdc2ef5 to
4e88449
Compare
for more information, see https://pre-commit.ci
|
@saroad2 Sure. I added a couple of tests for the return value. |
saroad2
left a comment
There was a problem hiding this comment.
Looks good.
I had one comment about the tests regarding the usage of _available_shells.clear(). If you have any questions about my comment, please feel free to ask.
for more information, see https://pre-commit.ci
|
Hey @alexreg , thank you for responding to my review. I'm glad I was able to introduce you to new concepts. I've added some small tweaks to your PR, mainly a small refactoring for the fixture, elaboration on the steps of the tests you wrote, and add one more test about using Happily merging the PR and hope to see your contributions again in the future! |
|
@saroad2 Looks good, re the tests. I'm not sure why I treated the dict like a value type in the fixture, but glad you fixed that too... Cheers. |
Decorators should return a possibly modfiied version of the original type. Hence, add_completion_class should return cls rather than merely None. This conforms to Python conventions, and allows type checking to work properly.
Checklist:
CHANGES.rstsummarizing the change and linking to the issue... versionchanged::entries in any relevant code docs.pre-commithooks and fix any issues.pytestandtox, no tests failed.