PYTHON-4147-fix: Remove quote wrapping and remove shell=true usage (#1513)

This commit is contained in:
Jib 2024-02-07 14:24:20 -05:00 committed by GitHub
parent 5c2e3991dc
commit fe37841f07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,9 +83,9 @@ class TestMonitor(IntegrationTest):
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)