I'm using pytest with bazel. To get bazel to pick up the fact that a pytest test has failed you need to put this at the end of every *_test.py file:
if __name__ == "__main__":
sys.exit(pytest.main([__file__]))
(See bazel-contrib/rules_python#240 )
It would be nice if this tool had an option to change the unittest-based snippet
if __name__ == "__main__":
unittest.main()
with the pytest one.
I'm using
pytestwith bazel. To get bazel to pick up the fact that apytesttest has failed you need to put this at the end of every*_test.pyfile:(See bazel-contrib/rules_python#240 )
It would be nice if this tool had an option to change the
unittest-based snippetwith the pytest one.