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)