def app(request):
"""py.test fixture to set up a dummy app for Redis testing.
:param request: pytest's FixtureRequest (internal class, cannot be hinted on a signature)
"""
config = testing.setUp()
config.add_route("home", "/")
config.add_route("redis_test", "/redis_test")
config.add_view(redis_test, route_name="redis_test")
# same is in test.ini
config.registry.settings["redis.sessions.url"] = "redis://localhost:6379/14"
def teardown():
testing.tearDown()
config.registry.redis = create_redis(config.registry)
app = TestApp(config.make_wsgi_app())
return app
评论列表
文章目录