[issue46126] Unittest output drives developers to avoid docstrings

Jason R. Coombs report at bugs.python.org
Sat Dec 18 18:08:24 EST 2021


New submission from Jason R. Coombs <jaraco at jaraco.com>:

In https://github.com/python/importlib_metadata/issues/302, I learned that the way unittest reports failures in tests is incentivizing the replacement of docstrings with comments in order not to make resolution of the relevant failing test more difficult to locate.

I presume I don't need to explain why docstrings are nice and preferable over comments.

Better would be for unittest to provide an option to ignore the docstrings or to emit the test path regardless of whether a docstring was present and to employ that option in CPython, allowing for docstrings in tests.

----------
components: Tests
messages: 408876
nosy: jaraco
priority: normal
severity: normal
status: open
title: Unittest output drives developers to avoid docstrings
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________


More information about the Python-bugs-list mailing list