Continuing in Python's unittest when an assertion fails

前端 未结 12 1568
感情败类
感情败类 2020-11-27 14:03

EDIT: switched to a better example, and clarified why this is a real problem.

I\'d like to write unit tests in Python that continue executing when an assertion fails

12条回答
  •  鱼传尺愫
    2020-11-27 14:50

    I realize this question was asked literally years ago, but there are now (at least) two Python packages that allow you to do this.

    One is softest: https://pypi.org/project/softest/

    The other is Python-Delayed-Assert: https://github.com/pr4bh4sh/python-delayed-assert

    I haven't used either, but they look pretty similar to me.

提交回复
热议问题