File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -59,14 +59,10 @@ async def _test_ops(
59
59
)
60
60
if isinstance (maybe_cursor , AsyncCommandCursor ):
61
61
await maybe_cursor .close ()
62
- tested = False
63
- # For some reason collection.list_indexes creates two commands and the first
64
- # one doesn't contain 'comment'.
65
- for i in listener .started_events :
66
- if cc == i .command .get ("comment" , "" ):
67
- self .assertEqual (cc , i .command ["comment" ])
68
- tested = True
69
- self .assertTrue (tested )
62
+
63
+ cmd = listener .started_events [0 ]
64
+ self .assertEqual (cc , cmd .command .get ("comment" ), msg = cmd )
65
+
70
66
if h .__name__ != "aggregate_raw_batches" :
71
67
self .assertIn (
72
68
":param comment:" ,
Original file line number Diff line number Diff line change @@ -59,14 +59,10 @@ def _test_ops(
59
59
)
60
60
if isinstance (maybe_cursor , CommandCursor ):
61
61
maybe_cursor .close ()
62
- tested = False
63
- # For some reason collection.list_indexes creates two commands and the first
64
- # one doesn't contain 'comment'.
65
- for i in listener .started_events :
66
- if cc == i .command .get ("comment" , "" ):
67
- self .assertEqual (cc , i .command ["comment" ])
68
- tested = True
69
- self .assertTrue (tested )
62
+
63
+ cmd = listener .started_events [0 ]
64
+ self .assertEqual (cc , cmd .command .get ("comment" ), msg = cmd )
65
+
70
66
if h .__name__ != "aggregate_raw_batches" :
71
67
self .assertIn (
72
68
":param comment:" ,
You can’t perform that action at this time.
0 commit comments