I am creating a conda recipe, and have added run_test.py . These are unittest classes. 
Unfortunatly, when there are errors, the package is still created. 
My question, how to inform conda that the test failed, and it should not continue with the package build.
run_test.py contains :

suit = unittest.TestLoader().discover("../tests/unitTest")#, pattern="test[AP][la]*[sr].py")
  unittest.TextTestRunner(verbosity=2).run(suit )

I do add the files in meta.yaml

test:
   files:
     - ../tests/unittest/

This is the output:

Ran 16 tests in 2.550s
FAILED (errors=5)
===== PACKAGE-NAME-None-np18py27_0 OK ====

I want to stop the build
The script needs to exit nonzero. If the tests fail, call sys.exit(1) in the script.
How to fail a conda package build when there are errors on run_test.py