Skip to content
Snippets Groups Projects
Commit 849a7bc6 authored by Amir Mohammadi's avatar Amir Mohammadi
Browse files

show the output of test commands

parent def39269
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -23,7 +23,7 @@ def _run(package, run_call):
temp_dir = tempfile.mkdtemp(prefix="bob_test")
# redirect output of functions to /dev/null to avoid spamming the console
devnull = open(os.devnull, 'w')
# devnull = open(os.devnull, 'w')
try:
# extract archive
......@@ -32,26 +32,26 @@ def _run(package, run_call):
package_dir = os.path.join(temp_dir, "bob.example.%s" % package)
# bootstrap
subprocess.call([sys.executable, "bootstrap-buildout.py"], cwd=package_dir, stdout=devnull, stderr=devnull)
subprocess.call([sys.executable, "bootstrap-buildout.py"], cwd=package_dir)
assert os.path.exists(os.path.join(package_dir, "bin", "buildout"))
# buildout
# if we have a setup.py in our current directory, we develop both (as we might be in the current source directory of bob.extension and use it),
# otherwise we only develop the downloaded source package
develop = '%s\n.'%os.getcwd() if os.path.exists("setup.py") else '.'
subprocess.call(['./bin/buildout', 'buildout:prefer-final=false', 'buildout:develop=%s'%develop], cwd=package_dir, stdout=devnull)
subprocess.call(['./bin/buildout', 'buildout:prefer-final=false', 'buildout:develop=%s'%develop], cwd=package_dir)
assert os.path.exists(os.path.join(package_dir, "bin", "python"))
# nosetests
subprocess.call(['./bin/nosetests', '-sv'], cwd=package_dir, stdout=devnull, stderr=devnull)
subprocess.call(['./bin/nosetests', '-sv'], cwd=package_dir)
# check that the call is working
subprocess.call(run_call, cwd=package_dir, stdout=devnull)
subprocess.call(run_call, cwd=package_dir)
subprocess.call(['./bin/sphinx-build', 'doc', 'sphinx'], cwd=package_dir, stdout=devnull)
subprocess.call(['./bin/sphinx-build', 'doc', 'sphinx'], cwd=package_dir)
assert os.path.exists(os.path.join(package_dir, "sphinx", "index.html"))
subprocess.call('./bin/python -c "import pkg_resources; from bob.example.%s import get_config; print(get_config())"'%package, cwd=package_dir, stdout=devnull, shell=True)
subprocess.call('./bin/python -c "import pkg_resources; from bob.example.%s import get_config; print(get_config())"'%package, cwd=package_dir, shell=True)
finally:
shutil.rmtree(temp_dir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment