Replaced subprocess commands by run() wherever possible.

This commit is contained in:
Claude Paroz 2019-08-23 10:53:36 +02:00 committed by Carlton Gibson
parent 7bd9633320
commit 9386586f31
13 changed files with 42 additions and 42 deletions

View file

@ -11,6 +11,7 @@ import weakref
import zipfile
from importlib import import_module
from pathlib import Path
from subprocess import CompletedProcess
from unittest import mock, skip, skipIf
from django.apps.registry import Apps
@ -345,7 +346,7 @@ class RestartWithReloaderTests(SimpleTestCase):
executable = '/usr/bin/python'
def patch_autoreload(self, argv):
patch_call = mock.patch('django.utils.autoreload.subprocess.call', return_value=0)
patch_call = mock.patch('django.utils.autoreload.subprocess.run', return_value=CompletedProcess(argv, 0))
patches = [
mock.patch('django.utils.autoreload.sys.argv', argv),
mock.patch('django.utils.autoreload.sys.executable', self.executable),