From 4ec5bae3d0d04a1f22c608929c22b57d25d9de3f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 23 Sep 2021 03:13:51 +0300 Subject: [PATCH] Tests(test_which): Add `'.py'` to `PATHEXT` on w32 --- tests/test_which.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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( -- 2.39.2