When running unittest with the -v flag, if a test has errors, and has a docstring, the test name is shown on one line, and the docstring is shown on the next line with the `ERROR` word.
For example:
./python.exe -m unittest -v Lib.test_verbose_error.randomTest
test_one (Lib.test_verbose_error.randomTest)
this is a doc string with helpful info ... ERROR
======================================================================
ERROR: test_one (Lib.test_verbose_error.randomTest)
this is a doc string with helpful info
----------------------------------------------------------------------
Traceback (most recent call last):
File "/workspaces/cpython/Lib/test_verbose_error.py", line 11, in test_one
assert l[1]
~^^^
IndexError: list index out of range
----------------------------------------------------------------------
Ran 1 test in 0.004s
This cause for some confusion and we would like to fix it, the possible options are:
1. print the name and docstring, and ERROR, all on one line.
2. provide a command-line switch to select that behavior.
The first option has a minor backwards compatibility breakage, since the default output would change and those lines would get longer.
Any thoughts on the mentioned solutions?
https://bugs.python.org/issue47133
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/KVHWPAVKIMYME6OBMK5CZKBA2C2HZD6F/
Code of Conduct: http://python.org/psf/codeofconduct/
For example:
./python.exe -m unittest -v Lib.test_verbose_error.randomTest
test_one (Lib.test_verbose_error.randomTest)
this is a doc string with helpful info ... ERROR
======================================================================
ERROR: test_one (Lib.test_verbose_error.randomTest)
this is a doc string with helpful info
----------------------------------------------------------------------
Traceback (most recent call last):
File "/workspaces/cpython/Lib/test_verbose_error.py", line 11, in test_one
assert l[1]
~^^^
IndexError: list index out of range
----------------------------------------------------------------------
Ran 1 test in 0.004s
This cause for some confusion and we would like to fix it, the possible options are:
1. print the name and docstring, and ERROR, all on one line.
2. provide a command-line switch to select that behavior.
The first option has a minor backwards compatibility breakage, since the default output would change and those lines would get longer.
Any thoughts on the mentioned solutions?
https://bugs.python.org/issue47133
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/KVHWPAVKIMYME6OBMK5CZKBA2C2HZD6F/
Code of Conduct: http://python.org/psf/codeofconduct/