New submission from Kit Choi <kc...@enthought.com>:

Following discussion in https://bugs.python.org/issue38296

The docstring of unittest.expectedFailure is misleading for people who 
differentiate "error" and "failure" when they read the sentence. This has a 
consequence of developers using the decorator without noticing unexpected 
errors are also silenced, which mean running a risk of their tests becoming 
unmaintained and invalid in the future.

I suggest updating the documentation to include a mention of the current 
behaviour of silencing unexpected errors, so that developers are aware of this.

Something like this?:

Mark the test such that unexpected success results in a failure. If an 
exception (BaseException excluding KeyboardInterrupt) occurs, the test will be 
considered a success. If the test passes, it will be considered a failure.

----------
assignee: docs@python
components: Documentation, Tests
messages: 353557
nosy: Kit Choi2, docs@python
priority: normal
severity: normal
status: open
title: Clarify unittest expectedFailure behaviour in the documentation
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38320>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to