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

Add type hints for a number of test helper functions #67

Closed

Conversation

adamtheturtle
Copy link
Contributor

This adds type hints for all pytest fixtures in
sybil/ and tests/, as well as some other test helper functions.

Some people prefer to use Iterator over Generator for typing pytest fixtures, but this can cause issues, e.g. https://youtrack.jetbrains.com/issue/PY-40318/pytest-fixtures-with-yield-return-types-defined-as-Iterator and Generator is an "accepted answer" on pytest-dev: pytest-dev/pytest#7809 (comment). I don't fully understand that, but I went with the accepted answer.

This adds type hints for all `pytest` fixtures in
`sybil/` and `tests/`, as well as some other test helper functions.

Some people prefer to use `Iterator` over `Generator` for typing
`pytest` fixtures, but this can cause issues, e.g.
https://youtrack.jetbrains.com/issue/PY-40318/pytest-fixtures-with-yield-return-types-defined-as-Iterator
and Generator is an "accepted answer" on `pytest-dev`:
pytest-dev/pytest#7809 (comment).
I don't fully understand that, but I went with the accepted answer.
@cjw296
Copy link
Member

cjw296 commented Aug 31, 2023

See #68 (comment)

@cjw296 cjw296 closed this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants