Closed LiraNuna closed 2 years ago
import pytest from sanic import Sanic from sanic_testing import TestManager @pytest.fixture def app(): sanic_app = Sanic(__name__) TestManager(sanic_app) return sanic_app @pytest.mark.asyncio async def test_not_found(app): request, response = await app.asgi_client.get("/not-a-known-endpoint") assert response.status == 404
This test will fail with an exception related to routing when ran.
This is true. Not related to sanic-testing though. A Sanic application MUST have at least one endpoint before it can be started.
I see. Thanks for confirming my suspicion. Closing.
This test will fail with an exception related to routing when ran.