Q&A

Tips

  • Blueprints Testing
  • test_cli.ws_connect does not work in sanic.__version__ <= '0.5.4', because of a Sanic bug, but it has been fixed in master branch.
  • Importing app has loop already running when you have db_init listeners.
  • Incorrect coverage report with pytest-cov, but we can have workarounds for this issue, it’s a pytest loading plugin problem essentially.
  • Websockets > 4.0 has broken websockets in sanic.__version__ <= '0.6.0', but it has been fixed in master
  • sanic_client/test_client is not an instance of sanic.testing.SanicTestClient. It is a simpler interface designed for easier testing. It randomizes the port used. The return value of get, post, etc is Response unlike (Request, Response) as that of SanicTestClient. See here for more info.

Feel free to create issue if you have any question. You can also check out closed issues