@@ -62,9 +62,7 @@ def test_started(self):
6262 self .assertEqual (
6363 span .attributes [SpanAttributes .DB_NAME ], "database_name"
6464 )
65- self .assertEqual (
66- span .attributes [SpanAttributes .DB_STATEMENT ], "find"
67- )
65+ self .assertEqual (span .attributes [SpanAttributes .DB_STATEMENT ], "find" )
6866 self .assertEqual (
6967 span .attributes [SpanAttributes .NET_PEER_NAME ], "test.com"
7068 )
@@ -201,9 +199,7 @@ def test_capture_statement_getmore(self):
201199 }
202200 mock_event = MockEvent (command_attrs )
203201
204- command_tracer = CommandTracer (
205- self .tracer , capture_statement = True
206- )
202+ command_tracer = CommandTracer (self .tracer , capture_statement = True )
207203 command_tracer .started (event = mock_event )
208204 command_tracer .succeeded (event = mock_event )
209205
@@ -214,18 +210,19 @@ def test_capture_statement_getmore(self):
214210
215211 self .assertEqual (
216212 span .attributes [SpanAttributes .DB_STATEMENT ],
217- "getMore test_collection"
213+ "getMore test_collection" ,
218214 )
219215
220216 def test_capture_statement_aggregate (self ):
221- pipeline = [{"$match" : {"status" : "active" }}, {"$group" : {"_id" : "$category" , "count" : {"$sum" : 1 }}}]
217+ pipeline = [
218+ {"$match" : {"status" : "active" }},
219+ {"$group" : {"_id" : "$category" , "count" : {"$sum" : 1 }}},
220+ ]
222221 command_attrs = {
223222 "command_name" : "aggregate" ,
224223 "pipeline" : pipeline ,
225224 }
226- command_tracer = CommandTracer (
227- self .tracer , capture_statement = True
228- )
225+ command_tracer = CommandTracer (self .tracer , capture_statement = True )
229226 mock_event = MockEvent (command_attrs )
230227 command_tracer .started (event = mock_event )
231228 command_tracer .succeeded (event = mock_event )
@@ -237,18 +234,15 @@ def test_capture_statement_aggregate(self):
237234
238235 expected_statement = f"aggregate { pipeline } "
239236 self .assertEqual (
240- span .attributes [SpanAttributes .DB_STATEMENT ],
241- expected_statement
237+ span .attributes [SpanAttributes .DB_STATEMENT ], expected_statement
242238 )
243239
244240 def test_capture_statement_disabled_getmore (self ):
245241 command_attrs = {
246242 "command_name" : "getMore" ,
247243 "collection" : "test_collection" ,
248244 }
249- command_tracer = CommandTracer (
250- self .tracer , capture_statement = False
251- )
245+ command_tracer = CommandTracer (self .tracer , capture_statement = False )
252246 mock_event = MockEvent (command_attrs )
253247 command_tracer .started (event = mock_event )
254248 command_tracer .succeeded (event = mock_event )
@@ -259,8 +253,7 @@ def test_capture_statement_disabled_getmore(self):
259253 span = spans_list [0 ]
260254
261255 self .assertEqual (
262- span .attributes [SpanAttributes .DB_STATEMENT ],
263- "getMore"
256+ span .attributes [SpanAttributes .DB_STATEMENT ], "getMore"
264257 )
265258
266259 def test_capture_statement_disabled_aggregate (self ):
@@ -269,9 +262,7 @@ def test_capture_statement_disabled_aggregate(self):
269262 "command_name" : "aggregate" ,
270263 "pipeline" : pipeline ,
271264 }
272- command_tracer = CommandTracer (
273- self .tracer , capture_statement = False
274- )
265+ command_tracer = CommandTracer (self .tracer , capture_statement = False )
275266 mock_event = MockEvent (command_attrs )
276267 command_tracer .started (event = mock_event )
277268 command_tracer .succeeded (event = mock_event )
@@ -282,8 +273,7 @@ def test_capture_statement_disabled_aggregate(self):
282273 span = spans_list [0 ]
283274
284275 self .assertEqual (
285- span .attributes [SpanAttributes .DB_STATEMENT ],
286- "aggregate"
276+ span .attributes [SpanAttributes .DB_STATEMENT ], "aggregate"
287277 )
288278
289279
0 commit comments