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: ```python if __name__ == "__main__": sys.exit(pytest.main([__file__])) ``` (See https://github.com/bazelbuild/rules_python/issues/240 ) It would be nice if this tool had an option to change the [`unittest`-based snippet](https://docs.python.org/3/library/unittest.html#unittest.main) ```python if __name__ == "__main__": unittest.main() ``` with the pytest one.