Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @pytest.yield_fixture
- def application():
- _app = create_app(configName='testing')
- _app_ctx = _app.app_context()
- _app_ctx.push()
- db.create_all()
- yield _app
- db.session.remove()
- db.drop_all()
- _app_ctx.pop()
- @pytest.fixture
- def application():
- _app = create_app(configName='testing')
- _app_ctx = _app.app_context()
- _app_ctx.push()
- db.create_all()
- def _finalize()
- db.session.remove()
- db.drop_all()
- _app_ctx.pop()
- request.addfinalizer(_finalize)
- return _app
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement