File tree Expand file tree Collapse file tree 3 files changed +18
-18
lines changed
src/superannotate/lib/core/usecases Expand file tree Collapse file tree 3 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 1+ import nest_asyncio
12from lib .core .usecases .annotations import * # noqa: F403 F401
23from lib .core .usecases .classes import * # noqa: F403 F401
34from lib .core .usecases .custom_fields import * # noqa: F403 F401
89from lib .core .usecases .models import * # noqa: F403 F401
910from lib .core .usecases .projects import * # noqa: F403 F401
1011
11- import nest_asyncio
12- nest_asyncio .apply ()
12+ nest_asyncio .apply ()
Original file line number Diff line number Diff line change 22import tempfile
33
44import pytest
5- from lib .core .entities .classes import AttributeGroup
65from src .superannotate import AppException
76from src .superannotate import SAClient
87from 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 ,
Original file line number Diff line number Diff 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 ):
You can’t perform that action at this time.
0 commit comments