From 20bd073e430c1ab330f46fadfce86bea419bc5d2 Mon Sep 17 00:00:00 2001 From: klinga Date: Fri, 16 Feb 2024 12:04:07 -0500 Subject: [PATCH] incorrect AttributeError replaced with TypeError --- bookops_worldcat/query.py | 2 +- tests/test_query.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bookops_worldcat/query.py b/bookops_worldcat/query.py index 21ec2f5..5bd2498 100644 --- a/bookops_worldcat/query.py +++ b/bookops_worldcat/query.py @@ -47,7 +47,7 @@ def __init__( """ if not isinstance(prepared_request, PreparedRequest): - raise AttributeError("Invalid type for argument 'prepared_request'.") + raise TypeError("Invalid type for argument 'prepared_request'.") # make sure access token is still valid and if not request a new one if session.authorization.is_expired(): diff --git a/tests/test_query.py b/tests/test_query.py index 50b62cf..8ccbf91 100644 --- a/tests/test_query.py +++ b/tests/test_query.py @@ -38,7 +38,7 @@ def test_query_live(live_keys): def test_query_not_prepared_request(stub_session): - with pytest.raises(AttributeError) as exc: + with pytest.raises(TypeError) as exc: req = Request("GET", "https://foo.org") Query(stub_session, req, timeout=2) assert "Invalid type for argument 'prepared_request'." in str(exc.value)