# Unittest: Fail if zero tests were discovered

**URL:** <https://discuss.python.org/t/unittest-fail-if-zero-tests-were-discovered/21498>\
**Category:** Ideas\
**Created:** [November 29, 2022, 12:44am UTC](https://discuss.python.org/t/unittest-fail-if-zero-tests-were-discovered/21498 "2022-11-29T00:44:46Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [November 29, 2022, 11:08am UTC](https://discuss.python.org/t/unittest-fail-if-zero-tests-were-discovered/21498/7 "2022-11-29T11:08:21Z")

</div>

It’s interesting that pytest has an exitcode for the “no tests ran” case: exit code 5. Maybe we should modify test.libregrtest to use the same exitcode (currently, it uses exit code 4 for this case).

---

_[View the full topic](https://discuss.python.org/t/unittest-fail-if-zero-tests-were-discovered/21498)._
