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

Function test_init_db_command

examples/tutorial/tests/test_db.py:19–29  ·  view source on GitHub ↗
(runner, monkeypatch)

Source from the content-addressed store, hash-verified

17
18
19def test_init_db_command(runner, monkeypatch):
20 class Recorder:
21 called = False
22
23 def fake_init_db():
24 Recorder.called = True
25
26 monkeypatch.setattr("flaskr.db.init_db", fake_init_db)
27 result = runner.invoke(args=["init-db"])
28 assert "Initialized" in result.output
29 assert Recorder.called

Callers

nothing calls this directly

Calls 1

invokeMethod · 0.45

Tested by

no test coverage detected