diff --git a/test/test_monitor.py b/test/test_monitor.py index 8ccec7fd0b..92bcdc49ad 100644 --- a/test/test_monitor.py +++ b/test/test_monitor.py @@ -83,9 +83,9 @@ def test_cleanup_executors_on_client_close(self): def test_no_thread_start_runtime_err_on_shutdown(self): """Test we silence noisy runtime errors fired when the MongoClient spawns a new thread on process shutdown.""" - command = [sys.executable, "-c", "'from pymongo import MongoClient; c = MongoClient()'"] + command = [sys.executable, "-c", "from pymongo import MongoClient; c = MongoClient()"] completed_process: subprocess.CompletedProcess = subprocess.run( - " ".join(command), shell=True, capture_output=True + command, capture_output=True ) self.assertFalse(completed_process.stderr)