diff --git a/test/python/run.py b/test/python/run.py index b6e318f936..a90d839431 100644 --- a/test/python/run.py +++ b/test/python/run.py @@ -15,12 +15,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # - +import sys import unittest # import xmlrunner +def main(): + loader = unittest.TestLoader() + tests = loader.discover('.') + testRunner = unittest.runner.TextTestRunner() + # testRunner = xmlrunner.XMLTestRunner(output='.') + ret = not testRunner.run(tests).wasSuccessful() + sys.exit(ret) + -loader = unittest.TestLoader() -tests = loader.discover('.') -testRunner = unittest.runner.TextTestRunner() -# testRunner = xmlrunner.XMLTestRunner(output='.') -testRunner.run(tests) +if __name__ == "__main__": + main() diff --git a/tool/travis/build.sh b/tool/travis/build.sh index f58d61ceec..bcfbd2aa8c 100644 --- a/tool/travis/build.sh +++ b/tool/travis/build.sh @@ -34,6 +34,7 @@ conda build tool/conda/singa --python 3.6 conda install --use-local singa cd test/python $HOME/miniconda/bin/python run.py +echo $? if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]]; # install and run unittest