Pārlūkot izejas kodu

Convert subprocess args to str for Python 3.5

Thomas Kluyver 5 gadi atpakaļ
vecāks
revīzija
bca8d5d4fe
1 mainītis faili ar 5 papildinājumiem un 4 dzēšanām
  1. 5 4
      nsist/tests/test_main.py

+ 5 - 4
nsist/tests/test_main.py

@@ -57,15 +57,15 @@ def test_installer(console_eg_copy, tmp_path):
     # Create installer
     run(
         [sys.executable, '-m', 'nsist', 'installer.cfg'],
-        cwd=console_eg_copy,
+        cwd=str(console_eg_copy),
         check=True,
     )
 
-    installer = Path(console_eg_copy, 'build', 'nsis', 'Guess_the_Number_1.0.exe')
+    installer = console_eg_copy / 'build' / 'nsis' / 'Guess_the_Number_1.0.exe'
     inst_dir = tmp_path / 'inst'
 
     # Run installer
-    run([installer, '/S', '/D={}'.format(inst_dir)], check=True)
+    run([str(installer), '/S', '/D={}'.format(inst_dir)], check=True)
     inst_python = inst_dir / 'Python' / 'python.exe'
     inst_launch_script = inst_dir / 'Sample_printer.launch.py'
 
@@ -75,7 +75,8 @@ def test_installer(console_eg_copy, tmp_path):
 
 
     # Run installed program
-    res = run([inst_python, inst_launch_script], check=True, stdout=PIPE)
+    res = run([str(inst_python), str(inst_launch_script)],
+              check=True, stdout=PIPE)
     json_res = json.loads(res.stdout)
 
     assert json_res['py_executable'] == str(inst_python)