|
@ -101,62 +101,13 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): |
|
|
if steps: |
|
|
if steps: |
|
|
command.extend(['--steps', steps]) |
|
|
command.extend(['--steps', steps]) |
|
|
|
|
|
|
|
|
current_env = os.environ.copy() |
|
|
if os.name == 'nt': |
|
|
current_env['PYTHONPATH'] = ';'.join(sys.path[1:]) |
|
|
# On windows, we need to pass the current env as argument |
|
|
print("#######") |
|
|
current_env = os.environ.copy() |
|
|
print(command) |
|
|
# and duplicate the current PythontPath |
|
|
print("#######") |
|
|
current_env['PYTHONPATH'] = ';'.join(sys.path[1:]) |
|
|
|
|
|
else: |
|
|
print("## sys.path (internal)") |
|
|
current_env = None |
|
|
print(sys.path) |
|
|
|
|
|
|
|
|
|
|
|
print("## sys.path (external)") |
|
|
|
|
|
syspath = subprocess.check_output([sys.executable, "-c", 'import sys;print(sys.path)'], |
|
|
|
|
|
stderr=subprocess.STDOUT, |
|
|
|
|
|
cwd=os.path.dirname(songbook), |
|
|
|
|
|
env=current_env) |
|
|
|
|
|
print(syspath) |
|
|
|
|
|
|
|
|
|
|
|
print("## import (external)") |
|
|
|
|
|
extimport = subprocess.check_output([sys.executable, "-c", 'import patacrep.songbook as sb;print(sb)']) |
|
|
|
|
|
print(extimport) |
|
|
|
|
|
|
|
|
|
|
|
print("### empty module") |
|
|
|
|
|
try: |
|
|
|
|
|
emptymod = subprocess.check_output([sys.executable, "-m", 'patacrep.songbook', 'empty.sb'], |
|
|
|
|
|
stderr=subprocess.STDOUT) |
|
|
|
|
|
print(emptymod) |
|
|
|
|
|
except subprocess.CalledProcessError as error: |
|
|
|
|
|
print(error.output) |
|
|
|
|
|
|
|
|
|
|
|
print("### cwd module") |
|
|
|
|
|
try: |
|
|
|
|
|
emptymod = subprocess.check_output( |
|
|
|
|
|
[sys.executable, "-m", 'patacrep.songbook', 'cwd.sb'], |
|
|
|
|
|
stderr=subprocess.STDOUT, |
|
|
|
|
|
cwd=os.path.dirname(songbook), |
|
|
|
|
|
env=current_env |
|
|
|
|
|
) |
|
|
|
|
|
print(emptymod) |
|
|
|
|
|
except subprocess.CalledProcessError as error: |
|
|
|
|
|
print(error.output) |
|
|
|
|
|
|
|
|
|
|
|
print("### import cwd") |
|
|
|
|
|
try: |
|
|
|
|
|
importcwd = subprocess.check_output( |
|
|
|
|
|
[sys.executable, "-c", 'import patacrep.songbook as sb;print(sb)'], |
|
|
|
|
|
stderr=subprocess.STDOUT, |
|
|
|
|
|
cwd=os.path.dirname(songbook), |
|
|
|
|
|
env=current_env |
|
|
|
|
|
) |
|
|
|
|
|
print(importcwd) |
|
|
|
|
|
except subprocess.CalledProcessError as error: |
|
|
|
|
|
print(error.output) |
|
|
|
|
|
|
|
|
|
|
|
print("### dir site-packages") |
|
|
|
|
|
dirres = subprocess.check_output(["dir", 'C:\projects\patacrep\.tox\py34\lib\site-packages']) |
|
|
|
|
|
print(dirres) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
subprocess.check_output( |
|
|
subprocess.check_output( |
|
@ -164,6 +115,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): |
|
|
stderr=subprocess.STDOUT, |
|
|
stderr=subprocess.STDOUT, |
|
|
universal_newlines=True, |
|
|
universal_newlines=True, |
|
|
cwd=os.path.dirname(songbook), |
|
|
cwd=os.path.dirname(songbook), |
|
|
|
|
|
env=current_env |
|
|
) |
|
|
) |
|
|
return 0 |
|
|
return 0 |
|
|
except subprocess.CalledProcessError as error: |
|
|
except subprocess.CalledProcessError as error: |
|
|