sanic-org / sanic-testing

Test clients for Sanic
https://sanic.dev/en/plugins/sanic-testing/getting-started.html
MIT License
31 stars 18 forks source link

sanic 21.12 compatibility #58

Closed staden closed 1 year ago

staden commented 1 year ago

sanic-testing 22.9 breaks compatibility with sanic 21.12:

>>> from sanic import Sanic
>>> app = Sanic('app')
>>> app.test_client.get('/')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../python3.9/site-packages/sanic_testing/testing.py", line 288, in get
    return self._sanic_endpoint_test("get", *args, **kwargs)
  File "/.../python3.9/site-packages/sanic_testing/testing.py", line 237, in _sanic_endpoint_test
    self.app.run(  # type: ignore
TypeError: run() got an unexpected keyword argument 'single_process'

sanic-testing 22.6 works though

ahopkins commented 1 year ago

Generally, you are advised to use the version corresponding to the core version.

ahopkins commented 1 year ago

Not sure we should plan to add backwards compat for this.

sjsadowski commented 1 year ago

@ahopkins I don't think so, but we should probably pin sanic-testing to its matching version and probably document the fact that sanic-testing should match the core version.