summaryrefslogtreecommitdiff
path: root/tests/utils_tests
diff options
context:
space:
mode:
authorCarlton Gibson <carlton@noumenal.es>2020-11-19 12:07:15 +0100
committerGitHub <noreply@github.com>2020-11-19 12:07:15 +0100
commitead37dfb580136cc27dbd487a1f1ad90c9235d15 (patch)
tree121c768ef00848bc7ab1927a046b54117e6cd62c /tests/utils_tests
parent9f72b0970db4be76d14bd7be5a21582d2cc484bc (diff)
Fixed #32202 -- Fixed autoreloader argument generation for Windows with Python 3.7-.
Diffstat (limited to 'tests/utils_tests')
-rw-r--r--tests/utils_tests/test_autoreload.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py
index e21414f702..b9f2db7276 100644
--- a/tests/utils_tests/test_autoreload.py
+++ b/tests/utils_tests/test_autoreload.py
@@ -178,10 +178,10 @@ class TestChildArguments(SimpleTestCase):
with tempfile.TemporaryDirectory() as tmpdir:
exe_path = Path(tmpdir) / '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):
with tempfile.TemporaryDirectory() as tmpdir:
script_path = Path(tmpdir) / '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'])
@@ -433,7 +433,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)