File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,16 @@ def __init__(self, collection):
77
77
self .success = False
78
78
79
79
def run (self ):
80
- async def _run_async () :
81
- assert await self .collection .find_one ({"$where" : delay (1 )}) is not None
80
+ if _IS_SYNC :
81
+ assert self .collection .find_one ({"$where" : delay (1 )}) is not None
82
82
self .success = True
83
+ else :
84
+
85
+ async def _run_async ():
86
+ assert await self .collection .find_one ({"$where" : delay (1 )}) is not None
87
+ self .success = True
83
88
84
- asyncio .run (_run_async ())
89
+ asyncio .run (_run_async ())
85
90
86
91
87
92
class TestGSSAPI (unittest .IsolatedAsyncioTestCase ):
Original file line number Diff line number Diff line change @@ -77,11 +77,16 @@ def __init__(self, collection):
77
77
self .success = False
78
78
79
79
def run (self ):
80
- def _run_async () :
80
+ if _IS_SYNC :
81
81
assert self .collection .find_one ({"$where" : delay (1 )}) is not None
82
82
self .success = True
83
+ else :
84
+
85
+ def _run_async ():
86
+ assert self .collection .find_one ({"$where" : delay (1 )}) is not None
87
+ self .success = True
83
88
84
- asyncio .run (_run_async ())
89
+ asyncio .run (_run_async ())
85
90
86
91
87
92
class TestGSSAPI (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments