1
+ import sys
1
2
from typing import Any
2
3
3
4
import pysubs2
@@ -49,7 +50,7 @@ def test_srt_to_microdvd() -> None:
49
50
50
51
51
52
def test_srt_to_microdvd_subprocess_pipe () -> None :
52
- cmd = ["python" , "-m" , "pysubs2" , "--to" , "microdvd" , "--fps" , "1000" ]
53
+ cmd = [sys . executable , "-m" , "pysubs2" , "--to" , "microdvd" , "--fps" , "1000" ]
53
54
output = subprocess .check_output (cmd , input = TEST_SRT_FILE , text = True )
54
55
assert output .strip () == TEST_MICRODVD_FILE .strip ()
55
56
@@ -410,7 +411,7 @@ def test_empty_notty_input_doesnt_print_help(capsys: Any, monkeypatch: Any) -> N
410
411
with tempfile .TemporaryDirectory () as temp_dir :
411
412
path = op .join (temp_dir , "test.srt" )
412
413
with open (path , "w+" ) as in_fp :
413
- cmd = ["python" , "-m" , "pysubs2" ]
414
+ cmd = [sys . executable , "-m" , "pysubs2" ]
414
415
p = subprocess .run (cmd , stdin = in_fp , stdout = subprocess .PIPE , stderr = subprocess .PIPE , text = True )
415
416
assert p .returncode == 1
416
417
assert not p .stdout .startswith ("usage: pysubs2" )
@@ -427,7 +428,7 @@ def test_win1250_passthrough_with_surrogateescape() -> None:
427
428
with open (input_path , "wb" ) as fp :
428
429
fp .write (input_bytes_win1250 )
429
430
430
- cmd = ["python" , "-m" , "pysubs2" , "-o" , output_dir , input_path ]
431
+ cmd = [sys . executable , "-m" , "pysubs2" , "-o" , output_dir , input_path ]
431
432
subprocess .check_call (cmd )
432
433
433
434
with open (output_path , "rb" ) as fp :
0 commit comments