MCPcopy
hub / github.com/pallets/flask / test_get_close_db

Function test_get_close_db

examples/tutorial/tests/test_db.py:8–16  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

6
7
8def test_get_close_db(app):
9 with app.app_context():
10 db = get_db()
11 assert db is get_db()
12
13 with pytest.raises(sqlite3.ProgrammingError) as e:
14 db.execute("SELECT 1")
15
16 assert "closed" in str(e.value)
17
18
19def test_init_db_command(runner, monkeypatch):

Callers

nothing calls this directly

Calls 2

get_dbFunction · 0.90
app_contextMethod · 0.80

Tested by

no test coverage detected