shell脚本中的Python unittest

时间:2019-05-29 13:37:55

标签: python shell python-unittest

作为CI / CD流程的一部分,我具有以下外壳程序脚本test.sh

docker-compose -f docker-compose.yml down
docker-compose -f docker-compose.yml up -d

cd ci/
python3 -m unittest discover tests

cd ..
docker-compose -f docker-compose.yml down

通常运行docker容器并对其进行测试的代码。 Python单元测试以退出代码1返回,但是shell脚本以返回代码0退出,而不是考虑Python脚本中的错误。

如何在外壳程序脚本本身中包含Python脚本的退出代码?

0 个答案:

没有答案