From: Oleg Broytman Date: Thu, 23 Sep 2021 00:13:51 +0000 (+0300) Subject: Tests(test_which): Add `'.py'` to `PATHEXT` on w32 X-Git-Tag: 0.8.0~2^2 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=4ec5bae3d0d04a1f22c608929c22b57d25d9de3f;p=ppu.git Tests(test_which): Add `'.py'` to `PATHEXT` on w32 --- diff --git a/tests/test_which.py b/tests/test_which.py index 3c5f855..af9886f 100755 --- a/tests/test_which.py +++ b/tests/test_which.py @@ -1,5 +1,6 @@ #! /usr/bin/env python +import os import subprocess import sys from ppu_tu import setup, teardown, find_in_path # noqa @@ -7,6 +8,13 @@ from ppu_tu import setup, teardown, find_in_path # noqa test_prog_path = find_in_path('which.py') +if sys.platform == 'win32': + os_env_pathext = os.environ['PATHEXT'] + pathext = os_env_pathext.lower().split(os.pathsep) + if '.py' not in pathext: + os_env_pathext += ';.py' + os.environ['PATHEXT'] = os_env_pathext + def test_which(): assert subprocess.check_output(