diff options
| author | Carlton Gibson <carlton@noumenal.es> | 2020-11-19 12:07:15 +0100 |
|---|---|---|
| committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2020-11-19 12:12:47 +0100 |
| commit | 012822c7f9eb2be2f44cb3235eb66ca207d37133 (patch) | |
| tree | ebd1600770d78d7eced239efbae15ad96e2fed01 /tests | |
| parent | 4f7517b5e02ecc327698e672efb7209502393e3d (diff) | |
[3.1.x] Fixed #32202 -- Fixed autoreloader argument generation for Windows with Python 3.7-.
Backport of ead37dfb580136cc27dbd487a1f1ad90c9235d15 from master
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/utils_tests/test_autoreload.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py index 72ae20ac12..096c395040 100644 --- a/tests/utils_tests/test_autoreload.py +++ b/tests/utils_tests/test_autoreload.py @@ -177,10 +177,10 @@ class TestChildArguments(SimpleTestCase): self.addCleanup(tmpdir.cleanup) exe_path = Path(tmpdir.name) / 'django-admin.exe' exe_path.touch() - with mock.patch('sys.argv', [exe_path.with_suffix(''), 'runserver']): + with mock.patch('sys.argv', [str(exe_path.with_suffix('')), 'runserver']): self.assertEqual( autoreload.get_child_arguments(), - [exe_path, 'runserver'] + [str(exe_path), 'runserver'] ) @mock.patch('sys.warnoptions', []) @@ -189,10 +189,10 @@ class TestChildArguments(SimpleTestCase): self.addCleanup(tmpdir.cleanup) script_path = Path(tmpdir.name) / 'django-admin-script.py' script_path.touch() - with mock.patch('sys.argv', [script_path.with_name('django-admin'), 'runserver']): + with mock.patch('sys.argv', [str(script_path.with_name('django-admin')), 'runserver']): self.assertEqual( autoreload.get_child_arguments(), - [sys.executable, script_path, 'runserver'] + [sys.executable, str(script_path), 'runserver'] ) @mock.patch('sys.argv', ['does-not-exist', 'runserver']) @@ -413,7 +413,7 @@ class RestartWithReloaderTests(SimpleTestCase): with tempfile.TemporaryDirectory() as temp_dir: script = Path(temp_dir) / 'manage.py' script.touch() - argv = [script, 'runserver'] + argv = [str(script), 'runserver'] mock_call = self.patch_autoreload(argv) autoreload.restart_with_reloader() self.assertEqual(mock_call.call_count, 1) |
