Skip to content

Commit 1fb34b9

Browse files
committed
fixed asyncio test
1 parent ddd195f commit 1fb34b9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_users.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from unittest.mock import Mock, patch
55

66
from flask.testing import FlaskClient
7+
import pytest
78
from werkzeug.datastructures import FileStorage
89

910
from lms.lmsdb.models import Course, User
@@ -244,12 +245,13 @@ def teardown(self):
244245
def open_file(filename: str) -> BufferedReader:
245246
return open(Path(conftest.SAMPLES_DIR) / filename, 'br')
246247

247-
def test_upload_avatar(self, student_user: User, captured_templates):
248+
@pytest.mark.asyncio
249+
async def test_upload_avatar(self, student_user: User, captured_templates):
248250
client = conftest.get_logged_user(student_user.username)
249-
conftest.upload_avatar(client, self.image_storage)
251+
await conftest.upload_avatar(client, self.image_storage)
250252
template, _ = captured_templates[-1]
251253
assert template.name == "user.html"
252-
conftest.upload_avatar(client, self.image_storage_2)
254+
await conftest.upload_avatar(client, self.image_storage_2)
253255
client.get('/avatar/delete')
254256
template, _ = captured_templates[-1]
255257
assert template.name == "user.html"

0 commit comments

Comments
 (0)