Open sashkab opened 4 years ago
there was a initial plan to provide those via multi scoped fixtures back for pytest 3.0 which failed
@nicoddemus would it be sensible to provide this workaround/pattern until pytest is actually structured to deliver multi scope fixtures
If jumping directly to multi-scoped fixtures is not feasible*, this sounds like a good workaround to me. I know Hypothesis would use monkeypatch_session
!
*though variable fixture scope sounds rather prone to user error, and I'm unsure that it's a good idea at all...
duplicate of longstanding #363
Currently if I need to create a fixture which has scope other than
function
, I have to re-implement every built-in fixture locally. If pytest does not support calling fixtures with multiple scopes, it should at least provide built-in fixtures with multiple scope. For example:Same goes for tmpdir, tmp_path, etc.