MCPcopy
hub / github.com/jarun/buku / app

Function app

tests/test_views.py:26–34  ·  view source on GitHub ↗
(dbfile)

Source from the content-addressed store, hash-verified

24
25@pytest.fixture()
26def app(dbfile):
27 app = server.create_app(dbfile)
28 app.config.update({'TESTING': True, 'WTF_CSRF_ENABLED': False})
29 # other setup can go here
30 yield app
31 # clean up / reset resources here
32 flask.g.bukudb.close()
33 if os.path.exists(dbfile):
34 os.remove(dbfile)
35
36def env_fixture(name, **kwargs): # place this fixture BEFORE app or its dependencies
37 """Produces a fixture that mocks a test parameter directly in an env var (before app init)"""

Callers

nothing calls this directly

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected