From fe2c706e9b0095bbf660cb79c49fbd6bef4689e5 Mon Sep 17 00:00:00 2001 From: Stuart Mitchell Date: Sun, 15 Mar 2015 06:42:23 +0000 Subject: [PATCH] added failure error code to tests --- .gitignore | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ src/pulp/pulp.py | 4 ++++ 2 files changed, 66 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fae935c --- /dev/null +++ b/.gitignore @@ -0,0 +1,62 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# virtualenv +py-ve* + +#cloud9 +.c9 \ No newline at end of file diff --git a/src/pulp/pulp.py b/src/pulp/pulp.py index b123991..91c363d 100644 --- a/src/pulp/pulp.py +++ b/src/pulp/pulp.py @@ -2254,6 +2254,7 @@ def pulpTestAll(): YAPOSIB ] + failed = False for s in solvers: if s().available(): try: @@ -2262,8 +2263,11 @@ def pulpTestAll(): except Exception as e: print(e) print("* Solver", s, "failed.") + failed = True else: print("Solver %s unavailable" % s) + if failed: + raise PulpError("Tests Failed") def pulpDoctest(): """