Skip to content

Commit ac67c81

Browse files
Normalize mixed-constructor argument errors to HyperbrowserError
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent d93d514 commit ac67c81

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

hyperbrowser/client/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(
2121
if config is not None and any(
2222
value is not None for value in (api_key, base_url, headers)
2323
):
24-
raise TypeError(
24+
raise HyperbrowserError(
2525
"Pass either `config` or `api_key`/`base_url`/`headers`, not both."
2626
)
2727

tests/test_custom_headers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,15 @@ def test_client_constructor_headers_override_environment_headers(monkeypatch):
314314

315315

316316
def test_client_constructor_rejects_mixed_config_and_direct_args():
317-
with pytest.raises(TypeError, match="Pass either `config`"):
317+
with pytest.raises(HyperbrowserError, match="Pass either `config`"):
318318
Hyperbrowser(
319319
config=ClientConfig(api_key="test-key"),
320320
headers={"X-Team-Trace": "team-1"},
321321
)
322322

323323

324324
def test_async_client_constructor_rejects_mixed_config_and_direct_args():
325-
with pytest.raises(TypeError, match="Pass either `config`"):
325+
with pytest.raises(HyperbrowserError, match="Pass either `config`"):
326326
AsyncHyperbrowser(
327327
config=ClientConfig(api_key="test-key"),
328328
headers={"X-Team-Trace": "team-1"},

0 commit comments

Comments
 (0)