Closed adamtheturtle closed 1 year ago
This adds type hints for all pytest fixtures in sybil/ and tests/, as well as some other test helper functions.
pytest
sybil/
tests/
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.
Iterator
Generator
pytest-dev
See https://github.com/simplistix/sybil/pull/68#issuecomment-1701176036
This adds type hints for all
pytest
fixtures insybil/
andtests/
, as well as some other test helper functions.Some people prefer to use
Iterator
overGenerator
for typingpytest
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" onpytest-dev
: https://github.com/pytest-dev/pytest/discussions/7809#discussioncomment-87250. I don't fully understand that, but I went with the accepted answer.