import pytest from the_works import create_app TEST_DATABASE_URI = "sqlite:///:memory:" @pytest.fixture() def app(): test_config = { "ENV": "Testing", "SQLALCHEMY_DATABASE_URI": TEST_DATABASE_URI, "TESTING": True } app = create_app(test_config) # other setup can go here yield app # clean up / reset resources here @pytest.fixture() def client(app): return app.test_client() @pytest.fixture() def runner(app): return app.test_cli_runner()