Skip to content

Commit 55bff2d

Browse files
committed
ignore sensitive cmds in monitoring
1 parent fdd7261 commit 55bff2d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/unified_format.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,19 @@
3737
from pymongo.client_session import ClientSession, TransactionOptions, _TxnState
3838
from pymongo.change_stream import ChangeStream
3939
from pymongo.collection import Collection
40-
from pymongo.cursor import Cursor
4140
from pymongo.database import Database
4241
from pymongo.errors import BulkWriteError, InvalidOperation, PyMongoError
4342
from pymongo.monitoring import (
4443
CommandFailedEvent, CommandListener, CommandStartedEvent,
45-
CommandSucceededEvent)
44+
CommandSucceededEvent, _SENSITIVE_COMMANDS)
4645
from pymongo.read_concern import ReadConcern
4746
from pymongo.read_preferences import ReadPreference
48-
from pymongo.results import BulkWriteResult, InsertManyResult, InsertOneResult
47+
from pymongo.results import BulkWriteResult
4948
from pymongo.write_concern import WriteConcern
5049

5150
from test import client_context, unittest, IntegrationTest
5251
from test.utils import (
53-
camel_to_snake, rs_or_single_client, single_client,
54-
snake_to_camel, ScenarioDict)
52+
camel_to_snake, rs_or_single_client, single_client, snake_to_camel)
5553

5654
from test.version import Version
5755
from test.utils import (
@@ -136,7 +134,7 @@ def parse_bulk_write_error_result(error):
136134
class EventListenerUtil(CommandListener):
137135
def __init__(self, observe_events, ignore_commands):
138136
self._event_types = set(observe_events)
139-
self._ignore_commands = set(ignore_commands)
137+
self._ignore_commands = _SENSITIVE_COMMANDS | set(ignore_commands)
140138
self._ignore_commands.add('configureFailPoint')
141139
self.results = []
142140

0 commit comments

Comments
 (0)