问题
I pytest, we declare the fixture scope (function, module, class, session) at the fixture definition. Is it possible to override that scope at the usage of it in a test? So that I can have a default function-scope fixture, but some tests which are using it use it as module-scope?
My concrete scenario is that I'm using parametrized tests, but I want my fixture to be used once over all parameters. Otherwise, the fixture is good to have function scope for all other tests.
来源:https://stackoverflow.com/questions/65722634/pytest-override-fixture-scope