Skip to content

Commit 1fc2fa9

Browse files
committed
chore: upgrade pytest-asyncio
1 parent 7d7d43e commit 1fc2fa9

15 files changed

+41
-259
lines changed

poetry.lock

Lines changed: 38 additions & 168 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ isort = "^5.10.1"
2727
pre-commit = "^2.20.0"
2828
pytest-cov = "^3.0.0"
2929
pytest-depends = "^1.0.1"
30-
pytest-asyncio = "^0.18.3"
30+
pytest-asyncio = "^0.19.0"
3131
Faker = "^13.15.0"
3232
unasync-cli = "^0.0.9"
3333
python-semantic-release = "^7.29.5"

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
asyncio_mode = auto

tests/_async/test_api_with_auto_confirm_disabled.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ async def create_api() -> AsyncIterable[AsyncGoTrueAPI]:
2727
password = fake.password()
2828

2929

30-
@pytest.mark.asyncio
3130
async def test_sign_up_with_email_and_password(api: AsyncGoTrueAPI):
3231
try:
3332
response = await api.sign_up_with_email(
@@ -45,7 +44,6 @@ async def test_sign_up_with_email_and_password(api: AsyncGoTrueAPI):
4544
password2 = fake.password()
4645

4746

48-
@pytest.mark.asyncio
4947
async def test_generate_sign_up_link(api: AsyncGoTrueAPI):
5048
try:
5149
response = await api.generate_link(
@@ -63,7 +61,6 @@ async def test_generate_sign_up_link(api: AsyncGoTrueAPI):
6361
email3 = f"api_generate_link_signup_{fake.email().lower()}"
6462

6563

66-
@pytest.mark.asyncio
6764
async def test_generate_magic_link(api: AsyncGoTrueAPI):
6865
try:
6966
response = await api.generate_link(
@@ -76,7 +73,6 @@ async def test_generate_magic_link(api: AsyncGoTrueAPI):
7673
assert False, str(e)
7774

7875

79-
@pytest.mark.asyncio
8076
async def test_generate_invite_link(api: AsyncGoTrueAPI):
8177
try:
8278
response = await api.generate_link(
@@ -89,7 +85,6 @@ async def test_generate_invite_link(api: AsyncGoTrueAPI):
8985
assert False, str(e)
9086

9187

92-
@pytest.mark.asyncio
9388
@pytest.mark.depends(on=[test_sign_up_with_email_and_password.__name__])
9489
async def test_generate_recovery_link(api: AsyncGoTrueAPI):
9590
try:

tests/_async/test_api_with_auto_confirm_enabled.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ async def create_api() -> AsyncIterable[AsyncGoTrueAPI]:
2828
valid_session: Optional[Session] = None
2929

3030

31-
@pytest.mark.asyncio
3231
async def test_sign_up_with_email(api: AsyncGoTrueAPI):
3332
global valid_session
3433
try:
@@ -43,7 +42,6 @@ async def test_sign_up_with_email(api: AsyncGoTrueAPI):
4342
assert False, str(e)
4443

4544

46-
@pytest.mark.asyncio
4745
@pytest.mark.depends(on=[test_sign_up_with_email.__name__])
4846
async def test_get_user(api: AsyncGoTrueAPI):
4947
try:
@@ -54,7 +52,6 @@ async def test_get_user(api: AsyncGoTrueAPI):
5452
assert False, str(e)
5553

5654

57-
@pytest.mark.asyncio
5855
@pytest.mark.depends(on=[test_get_user.__name__])
5956
async def test_delete_user(api: AsyncGoTrueAPI):
6057
try:

tests/_async/test_client_with_auto_confirm_disabled.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ async def create_client() -> AsyncIterable[AsyncGoTrueClient]:
2828
phone = fake.phone_number() # set test number here
2929

3030

31-
@pytest.mark.asyncio
3231
async def test_sign_up_with_email_and_password(client: AsyncGoTrueClient):
3332
try:
3433
response = await client.sign_up(
@@ -44,7 +43,6 @@ async def test_sign_up_with_email_and_password(client: AsyncGoTrueClient):
4443
assert False, str(e)
4544

4645

47-
@pytest.mark.asyncio
4846
@pytest.mark.depends(on=[test_sign_up_with_email_and_password.__name__])
4947
async def test_sign_up_with_the_same_user_twice_should_throw_an_error(
5048
client: AsyncGoTrueClient,
@@ -62,7 +60,6 @@ async def test_sign_up_with_the_same_user_twice_should_throw_an_error(
6260
assert False, str(e)
6361

6462

65-
@pytest.mark.asyncio
6663
@pytest.mark.depends(on=[test_sign_up_with_email_and_password.__name__])
6764
async def test_sign_in(client: AsyncGoTrueClient):
6865
expected_error_message = "Email not confirmed"
@@ -78,7 +75,6 @@ async def test_sign_in(client: AsyncGoTrueClient):
7875
assert False, str(e)
7976

8077

81-
@pytest.mark.asyncio
8278
@pytest.mark.depends(on=[test_sign_up_with_email_and_password.__name__])
8379
async def test_sign_in_with_the_wrong_password(client: AsyncGoTrueClient):
8480
expected_error_message = "Invalid login credentials"
@@ -94,7 +90,6 @@ async def test_sign_in_with_the_wrong_password(client: AsyncGoTrueClient):
9490
assert False, str(e)
9591

9692

97-
@pytest.mark.asyncio
9893
@pytest.mark.skipif(not TEST_TWILIO, reason="Twilio is not available")
9994
async def test_sign_up_with_phone_and_password(client: AsyncGoTrueClient):
10095
try:
@@ -112,7 +107,6 @@ async def test_sign_up_with_phone_and_password(client: AsyncGoTrueClient):
112107
assert False, str(e)
113108

114109

115-
@pytest.mark.asyncio
116110
@pytest.mark.skipif(not TEST_TWILIO, reason="Twilio is not available")
117111
@pytest.mark.depends(on=[test_sign_up_with_phone_and_password.__name__])
118112
async def test_verify_mobile_otp_errors_on_bad_token(client: AsyncGoTrueClient):

tests/_async/test_client_with_auto_confirm_enabled.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ async def create_new_client() -> AsyncIterable[AsyncGoTrueClient]:
5050
access_token: Optional[str] = None
5151

5252

53-
@pytest.mark.asyncio
5453
async def test_sign_up(client: AsyncGoTrueClient):
5554
try:
5655
response = await client.sign_up(
@@ -80,7 +79,6 @@ async def test_sign_up(client: AsyncGoTrueClient):
8079
assert False, str(e)
8180

8281

83-
@pytest.mark.asyncio
8482
async def test_set_session_should_return_no_error(
8583
client_with_session: AsyncGoTrueClient,
8684
):
@@ -101,7 +99,6 @@ async def test_set_session_should_return_no_error(
10199
assert False, str(e)
102100

103101

104-
@pytest.mark.asyncio
105102
@pytest.mark.depends(on=[test_sign_up.__name__])
106103
async def test_sign_up_the_same_user_twice_should_throw_an_error(
107104
client: AsyncGoTrueClient,
@@ -119,7 +116,6 @@ async def test_sign_up_the_same_user_twice_should_throw_an_error(
119116
assert False, str(e)
120117

121118

122-
@pytest.mark.asyncio
123119
@pytest.mark.depends(on=[test_sign_up.__name__])
124120
async def test_set_auth_should_set_the_auth_headers_on_a_new_client(
125121
new_client: AsyncGoTrueClient,
@@ -133,7 +129,6 @@ async def test_set_auth_should_set_the_auth_headers_on_a_new_client(
133129
assert False, str(e)
134130

135131

136-
@pytest.mark.asyncio
137132
@pytest.mark.depends(
138133
on=[test_set_auth_should_set_the_auth_headers_on_a_new_client.__name__]
139134
)
@@ -150,7 +145,6 @@ async def test_set_auth_should_set_the_auth_headers_on_a_new_client_and_recover(
150145
assert False, str(e)
151146

152147

153-
@pytest.mark.asyncio
154148
@pytest.mark.depends(on=[test_sign_up.__name__])
155149
async def test_sign_in(client: AsyncGoTrueClient):
156150
try:
@@ -173,7 +167,6 @@ async def test_sign_in(client: AsyncGoTrueClient):
173167
assert False, str(e)
174168

175169

176-
@pytest.mark.asyncio
177170
async def test_sign_in_with_refresh_token(client_with_session: AsyncGoTrueClient):
178171
try:
179172
response = await client_with_session.sign_up(
@@ -203,7 +196,6 @@ async def test_sign_in_with_refresh_token(client_with_session: AsyncGoTrueClient
203196
assert False, str(e)
204197

205198

206-
@pytest.mark.asyncio
207199
@pytest.mark.depends(on=[test_sign_in.__name__])
208200
async def test_get_user(client: AsyncGoTrueClient):
209201
try:
@@ -223,7 +215,6 @@ async def test_get_user(client: AsyncGoTrueClient):
223215
assert False, str(e)
224216

225217

226-
@pytest.mark.asyncio
227218
@pytest.mark.depends(on=[test_sign_in.__name__])
228219
async def test_get_session(client: AsyncGoTrueClient):
229220
try:
@@ -238,7 +229,6 @@ async def test_get_session(client: AsyncGoTrueClient):
238229
assert False, str(e)
239230

240231

241-
@pytest.mark.asyncio
242232
@pytest.mark.depends(on=[test_sign_in.__name__])
243233
async def test_update_user(client: AsyncGoTrueClient):
244234
try:
@@ -259,7 +249,6 @@ async def test_update_user(client: AsyncGoTrueClient):
259249
assert False, str(e)
260250

261251

262-
@pytest.mark.asyncio
263252
@pytest.mark.depends(on=[test_sign_in.__name__])
264253
async def test_update_user_dict(client: AsyncGoTrueClient):
265254
try:
@@ -278,7 +267,6 @@ async def test_update_user_dict(client: AsyncGoTrueClient):
278267
assert False, str(e)
279268

280269

281-
@pytest.mark.asyncio
282270
@pytest.mark.depends(on=[test_update_user.__name__])
283271
async def test_get_user_after_update(client: AsyncGoTrueClient):
284272
try:
@@ -297,7 +285,6 @@ async def test_get_user_after_update(client: AsyncGoTrueClient):
297285
assert False, str(e)
298286

299287

300-
@pytest.mark.asyncio
301288
@pytest.mark.depends(on=[test_get_user_after_update.__name__])
302289
async def test_sign_out(client: AsyncGoTrueClient):
303290
try:
@@ -309,7 +296,6 @@ async def test_sign_out(client: AsyncGoTrueClient):
309296
assert False, str(e)
310297

311298

312-
@pytest.mark.asyncio
313299
@pytest.mark.depends(on=[test_sign_out.__name__])
314300
async def test_get_user_after_sign_out(client: AsyncGoTrueClient):
315301
try:
@@ -320,7 +306,6 @@ async def test_get_user_after_sign_out(client: AsyncGoTrueClient):
320306
assert False, str(e)
321307

322308

323-
@pytest.mark.asyncio
324309
@pytest.mark.depends(on=[test_sign_out.__name__])
325310
async def test_get_update_user_after_sign_out(client: AsyncGoTrueClient):
326311
expected_error_message = "Not logged in."
@@ -334,7 +319,6 @@ async def test_get_update_user_after_sign_out(client: AsyncGoTrueClient):
334319
assert False, str(e)
335320

336321

337-
@pytest.mark.asyncio
338322
@pytest.mark.depends(on=[test_get_user_after_sign_out.__name__])
339323
async def test_sign_in_with_the_wrong_password(client: AsyncGoTrueClient):
340324
try:
@@ -346,7 +330,6 @@ async def test_sign_in_with_the_wrong_password(client: AsyncGoTrueClient):
346330
assert False, str(e)
347331

348332

349-
@pytest.mark.asyncio
350333
async def test_sign_up_with_password_none(client: AsyncGoTrueClient):
351334
expected_error_message = "Password must be defined, can't be None."
352335
try:
@@ -358,7 +341,6 @@ async def test_sign_up_with_password_none(client: AsyncGoTrueClient):
358341
assert False, str(e)
359342

360343

361-
@pytest.mark.asyncio
362344
async def test_sign_up_with_email_and_phone_none(client: AsyncGoTrueClient):
363345
expected_error_message = "Email or phone must be defined, both can't be None."
364346
try:
@@ -370,7 +352,6 @@ async def test_sign_up_with_email_and_phone_none(client: AsyncGoTrueClient):
370352
assert False, str(e)
371353

372354

373-
@pytest.mark.asyncio
374355
async def test_sign_in_with_all_nones(client: AsyncGoTrueClient):
375356
expected_error_message = (
376357
"Email, phone, refresh_token, or provider must be defined, "
@@ -385,7 +366,6 @@ async def test_sign_in_with_all_nones(client: AsyncGoTrueClient):
385366
assert False, str(e)
386367

387368

388-
@pytest.mark.asyncio
389369
async def test_sign_in_with_magic_link(client: AsyncGoTrueClient):
390370
try:
391371
response = await client.sign_in(email=email)
@@ -394,7 +374,6 @@ async def test_sign_in_with_magic_link(client: AsyncGoTrueClient):
394374
assert False, str(e)
395375

396376

397-
@pytest.mark.asyncio
398377
@pytest.mark.depends(on=[test_sign_up.__name__])
399378
async def test_get_session_from_url(client: AsyncGoTrueClient):
400379
try:
@@ -413,7 +392,6 @@ async def test_get_session_from_url(client: AsyncGoTrueClient):
413392
assert False, str(e)
414393

415394

416-
@pytest.mark.asyncio
417395
async def test_get_session_from_url_errors(client: AsyncGoTrueClient):
418396
try:
419397
dummy_url = "https://localhost"
@@ -465,7 +443,6 @@ async def test_get_session_from_url_errors(client: AsyncGoTrueClient):
465443
assert False, str(e)
466444

467445

468-
@pytest.mark.asyncio
469446
@pytest.mark.depends(on=[test_get_update_user_after_sign_out.__name__])
470447
async def test_refresh_session(client: AsyncGoTrueClient):
471448
try:

tests/_async/test_client_with_sign_ups_disabled.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ async def create_client() -> AsyncIterable[AsyncGoTrueClient]:
3838
password = fake.password()
3939

4040

41-
@pytest.mark.asyncio
4241
async def test_sign_up(client: AsyncGoTrueClient):
4342
expected_error_message = "Signups not allowed for this instance"
4443
try:
@@ -53,7 +52,6 @@ async def test_sign_up(client: AsyncGoTrueClient):
5352
invited_user = fake.email().lower()
5453

5554

56-
@pytest.mark.asyncio
5755
async def test_generate_link_should_be_able_to_generate_multiple_links(
5856
auth_admin: AsyncGoTrueAPI,
5957
):
@@ -105,7 +103,6 @@ async def test_generate_link_should_be_able_to_generate_multiple_links(
105103
email2 = fake.email().lower()
106104

107105

108-
@pytest.mark.asyncio
109106
async def test_create_user(auth_admin: AsyncGoTrueAPI):
110107
try:
111108
attributes = UserAttributes(email=email2)
@@ -120,7 +117,6 @@ async def test_create_user(auth_admin: AsyncGoTrueAPI):
120117
assert False, str(e)
121118

122119

123-
@pytest.mark.asyncio
124120
def test_default_headers(client: AsyncGoTrueClient):
125121
"""Test client for existing default headers"""
126122
default_key = "X-Client-Info"

tests/_async/test_provider.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ async def create_client() -> AsyncIterable[AsyncGoTrueClient]:
1818
yield client
1919

2020

21-
@pytest.mark.asyncio
2221
async def test_sign_in_with_provider(client: AsyncGoTrueClient):
2322
try:
2423
response = await client.sign_in(provider=Provider.google)
@@ -27,7 +26,6 @@ async def test_sign_in_with_provider(client: AsyncGoTrueClient):
2726
assert False, str(e)
2827

2928

30-
@pytest.mark.asyncio
3129
async def test_sign_in_with_provider_can_append_a_redirect_url(
3230
client: AsyncGoTrueClient,
3331
):
@@ -41,7 +39,6 @@ async def test_sign_in_with_provider_can_append_a_redirect_url(
4139
assert False, str(e)
4240

4341

44-
@pytest.mark.asyncio
4542
async def test_sign_in_with_provider_can_append_scopes(client: AsyncGoTrueClient):
4643
try:
4744
response = await client.sign_in(provider=Provider.google, scopes="repo")
@@ -50,7 +47,6 @@ async def test_sign_in_with_provider_can_append_scopes(client: AsyncGoTrueClient
5047
assert False, str(e)
5148

5249

53-
@pytest.mark.asyncio
5450
async def test_sign_in_with_provider_can_append_multiple_options(
5551
client: AsyncGoTrueClient,
5652
):

0 commit comments

Comments
 (0)