From 76ae5767172c15149d87ea9b75446b3addfcebe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 9 Dec 2024 08:29:04 +0800 Subject: [PATCH] Fix test cases for compatibility with httpx 0.28.0. --- pyproject.toml | 2 +- tests/test_auth.py | 3 ++- tests/test_flask_login.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8388d4f..dc4f67a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ dependencies = [ [project.optional-dependencies] devel = [ - "httpx", + "httpx >= 0.20.0", ] [project.urls] diff --git a/tests/test_auth.py b/tests/test_auth.py index f5c1491..bfa7290 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -66,7 +66,8 @@ class AuthenticationTestCase(unittest.TestCase): "DIGEST_AUTH_REALM": REALM, }) self.__client: httpx.Client = httpx.Client( - app=app, base_url="https://testserver") + transport=httpx.WSGITransport(app=app), + base_url="https://testserver") """The testing client.""" auth: DigestAuth = DigestAuth() diff --git a/tests/test_flask_login.py b/tests/test_flask_login.py index 0a88507..bcf30ea 100644 --- a/tests/test_flask_login.py +++ b/tests/test_flask_login.py @@ -91,7 +91,8 @@ class FlaskLoginTestCase(unittest.TestCase): "DIGEST_AUTH_REALM": REALM, }) self.__client: httpx.Client = httpx.Client( - app=self.app, base_url="https://testserver") + transport=httpx.WSGITransport(app=self.app), + base_url="https://testserver") """The testing client.""" self.__has_flask_login: bool = True