Support parameterized fixtures in doctests #13038
Labels
plugin: doctests
related to the doctests builtin plugin
topic: collection
related to the collection phase
topic: fixtures
anything involving fixtures directly or indirectly
type: docs
documentation improvement, missing or needing clarification
I'd like to be able to run all my doctests twice (once for each of my backends). This is essentially equivalent to a use case already described in your documentation. Here's what I'd like to do:
This works fine for normal pytests (yay 🎉) but fails on doctests.
I was surprised considering the pytest documentation on doctests says "fixtures marked as autouse are supported".
Any suggested workarounds? What would be needed to add support for parameterized autouse fixtures in doctests?
Details on the error
Note that the error (as explained in #4666) seems to stem from the fact that doctest doesn't detect the parameterized fixture during collection which means that it fails at runtime (as it doesn't know which backend to use).
The text was updated successfully, but these errors were encountered: