lundi 26 août 2019

Sanic how to load confguration for test app?

I want my test server to have a dummy config variables

I have the following fixture:


@pytest.fixture
def server():
    app.config.thing =1 #the dummy var
    return app.test_client


And a test

def test_thing(server):

    assert server.config.thing == 1

I get the following error:

AttributeError: 'SanicTestClient' object has no attribute 'config`

How do I fix this?

Aucun commentaire:

Enregistrer un commentaire