simplistix / sybil

Automated testing for the examples in your documentation.
https://sybil.readthedocs.io/en/latest/
Other
69 stars 14 forks source link

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

Closed adamtheturtle closed 1 year ago

adamtheturtle commented 1 year ago

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: https://github.com/pytest-dev/pytest/discussions/7809#discussioncomment-87250. I don't fully understand that, but I went with the accepted answer.

cjw296 commented 1 year ago

See https://github.com/simplistix/sybil/pull/68#issuecomment-1701176036