Skip to content

Commit

Permalink
fixed test runner script for AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenzel Jakob committed Oct 18, 2015
1 parent f297655 commit 9cc4ec9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions example/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def sanitize(lines):
line = line.strip()
if sys.platform == 'win32':
lower = line.lower()
if 'constructor' in lower or 'destructor' in lower or 'ref' in lower:
if 'constructor' in lower or 'destructor' in lower \
or 'ref' in lower:
line = ""
lines[i] = line

Expand All @@ -40,7 +41,15 @@ def sanitize(lines):
os.chdir(path)

name = sys.argv[1]
output_bytes = subprocess.check_output([sys.executable, name + ".py"])
try:
output_bytes = subprocess.check_output([sys.executable, name + ".py"],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
if 'import numpy' in e.output:
print('Test "%s" could not be run (NumPy is not installed).' % name)
exit(0)
raise

output = sanitize(output_bytes.decode('utf-8'))
reference = sanitize(open(name + '.ref', 'r').read())

Expand Down

0 comments on commit 9cc4ec9

Please sign in to comment.