Skip to content

Support Sanic 21 and later #70

@jwhitlock

Description

@jwhitlock

Sanic 21.12 will require changes in tests, and possibly in code.

Sanic 21.3 moved testing support from sanic.testing to a new module sanic-testing. This will require a different requirements file than Sanic 20.x to install sanic-testing.

There are other changes needed to support sanic-testing, such as changes to app registration and the test client. The changes are large enough that a new test file may be useful, rather than dynamically changing code based on the version.

There may be other changes in the framework itself. For example, this test:

dockerflow = Dockerflow()
assert "dockerflow.heartbeat" not in app.router.routes_names

fails with AttributeError: 'Router' object has no attribute 'routes_names'.

Currently, tests pass for Sanic 20.12.3, which is supported until December 2022. After this date, if we don't support Sanic 21.12, then we may want to drop Sanic support entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions