Skip to content

Commit 49c1788

Browse files
committed
fixes tests
1 parent f9eb4d6 commit 49c1788

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

tests/emailpassword/test_emaildelivery.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import json
1616
from typing import Any, Dict
1717
from pytest import fixture, mark, raises
18-
from supertokens_python.exceptions import GeneralError
1918

2019
import httpx
2120
import respx
@@ -1126,6 +1125,6 @@ async def test_send_reset_password_email_invalid_input(
11261125
link = await send_reset_password_email("public", "invalidUserId")
11271126
assert isinstance(link, SendResetPasswordEmailUnknownUserIdError)
11281127

1129-
with raises(GeneralError) as err:
1128+
with raises(Exception) as err:
11301129
await send_reset_password_email("invalidTenantId", user_info["id"])
11311130
assert "status code: 400" in str(err.value)

tests/emailpassword/test_passwordreset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from tests.testclient import TestClientWithNoCookieJar as TestClient
2222
from pytest import fixture, mark, raises
2323
from supertokens_python import InputAppInfo, SupertokensConfig, init
24-
from supertokens_python.exceptions import GeneralError
2524
from supertokens_python.framework import BaseRequest
2625
from supertokens_python.framework.fastapi import get_middleware
2726
from supertokens_python.recipe import emailpassword, session
@@ -394,7 +393,7 @@ async def test_create_reset_password_link(
394393
link = await create_reset_password_link("public", "invalidUserId")
395394
assert isinstance(link, CreateResetPasswordLinkUnknownUserIdError)
396395

397-
with raises(GeneralError) as err:
396+
with raises(Exception) as err:
398397
await create_reset_password_link("invalidTenantId", user_info["id"])
399398
assert "status code: 400" in str(err.value)
400399

tests/test_network_interceptor.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from tests.testclient import TestClientWithNoCookieJar as TestClient
66
from pytest import fixture, mark
77
from supertokens_python import InputAppInfo, SupertokensConfig, init
8-
from supertokens_python.exceptions import GeneralError
98
from supertokens_python.framework.fastapi import get_middleware
109
from supertokens_python.recipe import session, emailpassword, userroles
1110
from supertokens_python.recipe.emailpassword.asyncio import sign_in, sign_up
@@ -119,7 +118,7 @@ def intercept(
119118
],
120119
)
121120
start_st()
122-
with pytest.raises(GeneralError) as err:
121+
with pytest.raises(Exception) as err:
123122
await sign_up("public", "[email protected]", "validPassword123")
124123
assert "status code: 404" in str(err)
125124

@@ -161,7 +160,7 @@ def intercept(
161160
],
162161
)
163162
start_st()
164-
with pytest.raises(GeneralError) as err:
163+
with pytest.raises(Exception) as err:
165164
await get_roles_for_user("public", "someUserId")
166165
assert "status code: 400" in str(err)
167166

@@ -203,7 +202,7 @@ def intercept(
203202
)
204203
start_st()
205204

206-
with pytest.raises(GeneralError) as err:
205+
with pytest.raises(Exception) as err:
207206
await sign_in("public", "[email protected]", "validPassword123")
208207
assert "status code: 400" in str(err)
209208

tests/test_passwordless.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from tests.testclient import TestClientWithNoCookieJar as TestClient
1919
from pytest import fixture, mark, raises, skip
2020
from supertokens_python import InputAppInfo, SupertokensConfig, init
21-
from supertokens_python.exceptions import GeneralError
2221
from supertokens_python.framework.fastapi import get_middleware
2322
from supertokens_python.querier import Querier
2423
from supertokens_python.recipe import passwordless, session
@@ -400,7 +399,7 @@ async def send_sms(
400399
# Delete the email
401400
response = await delete_email_for_user(user_id)
402401
# Delete the phone number (Should raise exception because deleting both of them isn't allowed)
403-
with raises(GeneralError) as e:
402+
with raises(Exception) as e:
404403
response = await delete_phone_number_for_user(user_id)
405404

406405
assert e.value.args[0].endswith(

0 commit comments

Comments
 (0)