Skip to content

Commit a255d59

Browse files
Narek MkhitaryanNarek Mkhitaryan
authored andcommitted
fix OCR group type tests
1 parent 233c790 commit a255d59

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/superannotate/lib/core/usecases/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import nest_asyncio
12
from lib.core.usecases.annotations import * # noqa: F403 F401
23
from lib.core.usecases.classes import * # noqa: F403 F401
34
from lib.core.usecases.custom_fields import * # noqa: F403 F401
@@ -8,5 +9,4 @@
89
from lib.core.usecases.models import * # noqa: F403 F401
910
from lib.core.usecases.projects import * # noqa: F403 F401
1011

11-
import nest_asyncio
12-
nest_asyncio.apply()
12+
nest_asyncio.apply()

tests/integration/classes/test_create_annotation_class.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import tempfile
33

44
import pytest
5-
from lib.core.entities.classes import AttributeGroup
65
from src.superannotate import AppException
76
from src.superannotate import SAClient
87
from tests import DATA_SET_PATH
@@ -252,18 +251,16 @@ def test_create_annotation_class_via_ocr_group_type(self):
252251
f"OCR attribute group is not supported for project type {self.PROJECT_TYPE}.",
253252
):
254253
attribute_groups = [
255-
AttributeGroup(
256-
**{
257-
"id": 21448,
258-
"class_id": 56820,
259-
"name": "Large",
260-
"group_type": "ocr",
261-
"is_multiselect": 0,
262-
"createdAt": "2020-09-29T10:39:39.000Z",
263-
"updatedAt": "2020-09-29T10:39:39.000Z",
264-
"attributes": [],
265-
}
266-
)
254+
{
255+
"id": 21448,
256+
"class_id": 56820,
257+
"name": "Large",
258+
"group_type": "ocr",
259+
"is_multiselect": 0,
260+
"createdAt": "2020-09-29T10:39:39.000Z",
261+
"updatedAt": "2020-09-29T10:39:39.000Z",
262+
"attributes": [],
263+
}
267264
]
268265
sa.create_annotation_class(
269266
self.PROJECT_NAME,

tests/unit/test_async_functions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,21 @@ async def _test():
6363
task2 = asyncio.create_task(self.nested())
6464
await task1
6565
await task2
66+
6667
asyncio.run(_test())
6768

6869
def test_gather_get_annotations_in_running_event_loop(self):
6970
async def gather_test():
7071
await asyncio.gather(self.nested(), self.nested())
72+
7173
asyncio.run(gather_test())
7274

7375
def test_gather_async_for(self):
7476
async def gather_test():
75-
async for _ in DummyIterator(delay=0.01, to=2):
76-
annotations = sa.get_annotations(TestAsyncFunctions.PROJECT_NAME)
77-
assert len(annotations) == 4
77+
async for _ in DummyIterator(delay=0.01, to=2):
78+
annotations = sa.get_annotations(TestAsyncFunctions.PROJECT_NAME)
79+
assert len(annotations) == 4
80+
7881
asyncio.run(gather_test())
7982

8083
def test_upload_annotations_in_running_event_loop(self):

0 commit comments

Comments
 (0)