MCPcopy Create free account
hub / github.com/pallets/flask / expect_exception

Function expect_exception

tests/test_basic.py:364–366  ·  view source on GitHub ↗
(f, *args, **kwargs)

Source from the content-addressed store, hash-verified

362 app.secret_key = None
363
364 def expect_exception(f, *args, **kwargs):
365 e = pytest.raises(RuntimeError, f, *args, **kwargs)
366 assert e.value.args and "session is unavailable" in e.value.args[0]
367
368 with app.test_request_context():
369 assert flask.session.get("missing_key") is None

Callers 1

test_missing_sessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected