File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ async def _test_ops(
58
58
listener .reset ()
59
59
kwargs = {"comment" : cc }
60
60
if h == coll .rename :
61
- _ = await db .get_collection ("temp_temp_temp" ).drop ()
61
+ await db .get_collection ("temp_temp_temp" ).drop ()
62
62
destruct_coll = db .get_collection ("test_temp" )
63
63
await destruct_coll .insert_one ({})
64
64
maybe_cursor = await destruct_coll .rename (* args , ** kwargs )
@@ -68,11 +68,11 @@ async def _test_ops(
68
68
await coll .insert_one ({})
69
69
maybe_cursor = await db .validate_collection (* args , ** kwargs )
70
70
else :
71
- if iscoroutinefunction (coll .create_index ):
72
- await coll .create_index ("a" )
73
- else :
71
+ if not _IS_SYNC and isinstance (coll , Empty ):
74
72
coll .create_index ("a" )
75
- if iscoroutinefunction (h ):
73
+ else :
74
+ await coll .create_index ("a" )
75
+ if not _IS_SYNC and iscoroutinefunction (h ):
76
76
maybe_cursor = await h (* args , ** kwargs )
77
77
else :
78
78
maybe_cursor = h (* args , ** kwargs )
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def _test_ops(
58
58
listener .reset ()
59
59
kwargs = {"comment" : cc }
60
60
if h == coll .rename :
61
- _ = db .get_collection ("temp_temp_temp" ).drop ()
61
+ db .get_collection ("temp_temp_temp" ).drop ()
62
62
destruct_coll = db .get_collection ("test_temp" )
63
63
destruct_coll .insert_one ({})
64
64
maybe_cursor = destruct_coll .rename (* args , ** kwargs )
@@ -68,11 +68,11 @@ def _test_ops(
68
68
coll .insert_one ({})
69
69
maybe_cursor = db .validate_collection (* args , ** kwargs )
70
70
else :
71
- if iscoroutinefunction (coll . create_index ):
71
+ if not _IS_SYNC and isinstance (coll , Empty ):
72
72
coll .create_index ("a" )
73
73
else :
74
74
coll .create_index ("a" )
75
- if iscoroutinefunction (h ):
75
+ if not _IS_SYNC and iscoroutinefunction (h ):
76
76
maybe_cursor = h (* args , ** kwargs )
77
77
else :
78
78
maybe_cursor = h (* args , ** kwargs )
You can’t perform that action at this time.
0 commit comments