Commit 3b0dc503 authored by Boxiang Sun's avatar Boxiang Sun

Basic test fixing

The python which slapos used to run runTestSuite and the python which
installed by SlapOS is not identical...
parent 8c09dbe0
import subprocess import subprocess
import importlib import importlib
import json import build_extension
def run(env, python_path): def run(env, python_path):
# Build the extension when installing the Cython in slapos source = subprocess.check_output([python_path + " -c 'import nogil_extension; a = nogil_extension.bag(); print(a)'"],
# subprocess.call([python_path, 'nogil_extension.py', 'build_ext', '--inplace'], env=env) env=env,
source = '' shell=True,
)
failure_count = 0 failure_count = 0
try: if source != b'4.0\n42.0\n':
nogil_extension = importlib.import_module('nogil_extension')
except ImportError as e:
source = str(e)
failure_count = 1
else:
source = nogil_extension.bag()
if source != '4.0\n42.0':
failure_count = 1 failure_count = 1
result_dict = {'failed':failure_count, 'stdout':source} result_dict = {'failed': failure_count, 'stdout': source}
return result_dict return result_dict
# print(json.dumps(result_dict))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment