Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Test theVersion class#287

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AA-Turner merged 2 commits intopython:mainfromhugovk:test-version
Apr 15, 2025
Merged

Test theVersion class#287

AA-Turner merged 2 commits intopython:mainfromhugovk:test-version
Apr 15, 2025

Conversation

@hugovk
Copy link
Member

No description provided.

from build_docs import Version


def test_equality() -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Are all the-> None necessary?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nope, type annotations are completely optional in Python :)

More seriously, they could be omitted, as we're not running mypy on this repo (yet).

And generally, it is a good idea to also type hints to tests (for example, seehttps://sethmlarson.dev/tests-arent-enough-case-study-after-adding-types-to-urllib3#type-your-tests) and that could cover these returns too.

It can be useful in tests to help immediately differentiate from fixtures and helper methods which do return something, for example in#288.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I was referring specifically to the tests (not fixtures or other helper functions), since they (always?) returnNone, making the-> None superfluous.
I guess it makes sense to add it for consistency, both with other functions/methods that have the return type, or for tests that have types for the their args?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah, we can remove them if you prefer, I don't mind too much either way. But when we add mypy, let's add them back if it complains about it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Adding them opt-in the function to be checked by mypy, so it will be usefull if we use mypy on this repo sometime.

AA-Turner reacted with thumbs up emoji
@AA-TurnerAA-Turner merged commit9f45c4e intopython:mainApr 15, 2025
10 checks passed
@hugovkhugovk deleted the test-version branchApril 16, 2025 07:42
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JulienPalardJulienPalardJulienPalard left review comments

@ezio-melottiezio-melottiezio-melotti left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@hugovk@JulienPalard@ezio-melotti@AA-Turner

[8]ページ先頭

©2009-2025 Movatter.jp