]> git.phdru.name Git - ppu.git/commitdiff
Tests(test_which): Add `'.py'` to `PATHEXT` on w32
authorOleg Broytman <phd@phdru.name>
Thu, 23 Sep 2021 00:13:51 +0000 (03:13 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 23 Sep 2021 00:13:51 +0000 (03:13 +0300)
tests/test_which.py

index 3c5f85583a83931e3a8011885e8d3ffbcbcc4996..af9886f81e68f1f142241b25096115d387914015 100755 (executable)
@@ -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(