Change scope of live server to session by TWood67 · Pull Request #113 · pytest-dev/pytest-flask (original) (raw)
Hi @TWood67,
Ah yeah, looking at pytest, request is scoped to function
Actually request
has multiple scopes, so this should be fine here.
I think we lose the capability of setting the flask config via options
You mean because of monkeypatch
? Indeed monkeypatch
is function-scoped only, but we might get away with patching options
ourselves, like done in live_server
: store the original config, set the new config, and restore the original config when the test finishes.