def with_request_context(): """Run the test inside of a request context. This combines flask's request context with our own setup. It is intended to be used via pytests' `yield_fixture`, but like the other fixtures in this module, must be declared as such in the test module itself. """ with app.test_request_context(): init_auth() yield