Skip to content

Commit

Permalink
incorrect AttributeError replaced with TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
klinga committed Feb 16, 2024
1 parent 63778be commit 20bd073
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bookops_worldcat/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 20bd073

Please sign in to comment.