diff --git a/src/webargs/__init__.py b/src/webargs/__init__.py index 15a2f480..aa6587ae 100755 --- a/src/webargs/__init__.py +++ b/src/webargs/__init__.py @@ -14,8 +14,8 @@ __version__ = importlib.metadata.version("webargs") __parsed_version__ = Version(__version__) __version_info__: tuple[int, int, int] | tuple[int, int, int, str, int] = ( - __parsed_version__.release -) # type: ignore[assignment] + __parsed_version__.release # type: ignore[assignment] +) if __parsed_version__.pre: __version_info__ += __parsed_version__.pre # type: ignore[assignment] __all__ = ("ValidationError", "fields", "missing", "validate") diff --git a/tests/test_tornadoparser.py b/tests/test_tornadoparser.py index 4e2b2e14..ea206ab8 100644 --- a/tests/test_tornadoparser.py +++ b/tests/test_tornadoparser.py @@ -8,8 +8,8 @@ import tornado.httpserver import tornado.httputil import tornado.ioloop +import tornado.testing import tornado.web -from tornado.testing import AsyncHTTPTestCase from webargs import fields, missing from webargs.core import json, parse_json @@ -20,6 +20,22 @@ use_kwargs, ) + +class BaseAsyncTestCase(tornado.testing.AsyncHTTPTestCase): + # this isn't a real test case itself + __test__ = False + + # Workaround for https://github.com/pytest-dev/pytest/issues/12263. + # + # this was suggested by one of the pytest maintainers while a patch + # for Tornado is pending + # + # we may need it even after the patch, since we want to support testing on + # older Tornado versions until we drop support for them + def runTest(self): + pass + + name = "name" value = "value" @@ -460,7 +476,7 @@ def get(self, id, args): ) -class TestApp(AsyncHTTPTestCase): +class TestApp(BaseAsyncTestCase): def get_app(self): return echo_app @@ -528,7 +544,7 @@ def post(self, args): ) -class TestValidateApp(AsyncHTTPTestCase): +class TestValidateApp(BaseAsyncTestCase): def get_app(self): return validate_app