From bd2b824bfc1598444abcb4642a7a9694086fa0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lafr=C3=A9choux?= Date: Tue, 2 Jul 2024 10:50:34 +0200 Subject: [PATCH] Fix ruff warnings --- tests/test_etag.py | 6 +++--- tests/test_pagination.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_etag.py b/tests/test_etag.py index a6e74dc..ff64d39 100644 --- a/tests/test_etag.py +++ b/tests/test_etag.py @@ -227,7 +227,7 @@ def test_etag_check_etag_wrong_method_warning( assert not recwarn else: assert len(recwarn) == 1 - assert recwarn[0].category == UserWarning + assert recwarn[0].category is UserWarning assert str(recwarn[0].message) == ( f"ETag cannot be checked on {method} request." ) @@ -250,7 +250,7 @@ def test_etag_verify_check_etag_warning(self, app, method, recwarn): blp._verify_check_etag() if method in ["PUT", "PATCH", "DELETE"]: assert len(recwarn) == 1 - assert recwarn[0].category == UserWarning + assert recwarn[0].category is UserWarning assert str(recwarn[0].message) == ( f"ETag not checked in endpoint {f_request.endpoint} " f"on {method} request." @@ -345,7 +345,7 @@ def test_etag_set_etag_method_not_allowed_warning( assert not recwarn else: assert len(recwarn) == 1 - assert recwarn[0].category == UserWarning + assert recwarn[0].category is UserWarning assert str(recwarn[0].message) == ( f"ETag cannot be set on {method} request." ) diff --git a/tests/test_pagination.py b/tests/test_pagination.py index 455dfbe..3c445cf 100644 --- a/tests/test_pagination.py +++ b/tests/test_pagination.py @@ -219,7 +219,7 @@ def func(pagination_parameters): assert not recwarn else: assert len(recwarn) == 1 - assert recwarn[0].category == UserWarning + assert recwarn[0].category is UserWarning assert str(recwarn[0].message) == ( "item_count not set in endpoint test.func." )