[issue38320] Clarify unittest expectedFailure behaviour in the documentation
New submission from Kit Choi <kchoi@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 <report@bugs.python.org> <https://bugs.python.org/issue38320> _______________________________________
Change by Irit Katriel <iritkatriel@yahoo.com>: ---------- keywords: +patch nosy: +iritkatriel nosy_count: 2.0 -> 3.0 pull_requests: +21703 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22740 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38320> _______________________________________
Steve Dower <steve.dower@python.org> added the comment: New changeset fa8748271a61177e9bf609921fa464cc6990478b by Irit Katriel in branch 'master': bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740) https://github.com/python/cpython/commit/fa8748271a61177e9bf609921fa464cc699... ---------- nosy: +steve.dower _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38320> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +21741 pull_request: https://github.com/python/cpython/pull/22782 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38320> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +21742 pull_request: https://github.com/python/cpython/pull/22783 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38320> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset f9fa920c30326050a7096c5cb3594465d1e75ff2 by Miss Islington (bot) in branch '3.9': [3.9] bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740) (GH-22783) https://github.com/python/cpython/commit/f9fa920c30326050a7096c5cb3594465d1e... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38320> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 5f463e501b9667d1059a1e916d59d19cdd6addf7 by Miss Islington (bot) in branch '3.8': [3.8] bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740) (GH-22782) https://github.com/python/cpython/commit/5f463e501b9667d1059a1e916d59d19cdd6... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38320> _______________________________________
Change by Irit Katriel <iritkatriel@yahoo.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38320> _______________________________________
participants (4)
-
Irit Katriel -
Kit Choi -
miss-islington -
Steve Dower