This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: regrtest: log test loader errors
Type: Stage:
Components: Tests Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, r.david.murray, vstinner
Priority: normal Keywords: patch

Created on 2015-01-01 22:38 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
regrtest.patch vstinner, 2015-01-01 22:38 review
test_asyncio_bug.patch vstinner, 2015-01-01 22:39 review
Messages (4)
msg233298 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-01-01 22:38
Currently, when regrtest fails to load a test submodule, no exception is raised, no error is logged.

I propose to at least log all loader errors: see attached regrtest.patch.

For an example, try to apply the attached test_asyncio_bug.patch and run:
./python -m test -m test_not_implemented test_asyncio

The current output is:
---
[1/1] test_asyncio
1 test OK.
---

The output with regrtest.patch:
---
haypo@selma$ ./python -m test -m test_not_implemented test_asyncio
[1/1] test_asyncio
Failed to import test module: test.test_asyncio.test_base_events
Traceback (most recent call last):
  File "/home/haypo/prog/python/default/Lib/unittest/loader.py", line 417, in _find_test_path
    module = self._get_module_from_name(name)
  File "/home/haypo/prog/python/default/Lib/unittest/loader.py", line 358, in _get_module_from_name
    __import__(name)
  File "/home/haypo/prog/python/default/Lib/test/test_asyncio/test_base_events.py", line 29
    class BaseEventLoopTests(test_utils.TestCase)
                                                ^
SyntaxError: invalid syntax

1 test OK.
---

Or should we raise an exception instead?
msg233305 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-01-02 04:19
loader.errors only exists in 3.5.
msg233539 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-01-06 13:09
New changeset 1bb3df5bb83f by Victor Stinner in branch 'default':
Issue #23145: regrtest now shows errors and raises an exception if
https://hg.python.org/cpython/rev/1bb3df5bb83f
msg233540 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-01-06 13:09
I chose to show errors and then raise an exception.
History
Date User Action Args
2022-04-11 14:58:11adminsetgithub: 67334
2015-01-06 13:09:59vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg233540
2015-01-06 13:09:37python-devsetnosy: + python-dev
messages: + msg233539
2015-01-02 04:19:45r.david.murraysetnosy: + r.david.murray

messages: + msg233305
versions: - Python 2.7, Python 3.4
2015-01-01 22:39:13vstinnersetfiles: + test_asyncio_bug.patch
2015-01-01 22:38:59vstinnercreate