def test_app_factory_pattern(app): sendwithus = Sendwithus() sendwithus.init_app(app) with pytest.raises(RuntimeError): assert sendwithus.api_key == TEST_API_KEY with app.test_request_context(): assert sendwithus.api_key == TEST_API_KEY
def sendwithus(app): sendwithus = Sendwithus() sendwithus.init_app(app) return sendwithus