diff options
| author | Claude Paroz <claude@2xlibre.net> | 2019-08-23 10:53:36 +0200 |
|---|---|---|
| committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2019-08-23 10:53:36 +0200 |
| commit | 9386586f31b8a0bccf59a1bff647cd829d4e79aa (patch) | |
| tree | f28bf4c9b8b0a1431c1b6722f9d5bb613d78040f /tests/utils_tests/test_autoreload.py | |
| parent | 7bd963332017eace00be8caf7dc1b7b304da613a (diff) | |
Replaced subprocess commands by run() wherever possible.
Diffstat (limited to 'tests/utils_tests/test_autoreload.py')
| -rw-r--r-- | tests/utils_tests/test_autoreload.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py index b673c5e1c0..2216d003ee 100644 --- a/tests/utils_tests/test_autoreload.py +++ b/tests/utils_tests/test_autoreload.py @@ -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), |
