我希望我的测试服务器有一个虚拟配置变量
我有以下夹具:
@pytest.fixture
def server():
app.config.thing =1 #the dummy var
return app.test_client
和一个测试
def test_thing(server):
assert server.config.thing == 1
我收到以下错误:
AttributeError:“SanicTestClient”对象没有属性“config”
我该如何解决?