[New-bugs-announce] [issue23145] regrtest: log test loader errors

STINNER Victor report at bugs.python.org
Thu Jan 1 23:38:59 CET 2015


New submission from STINNER Victor:

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 at 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?

----------
components: Tests
files: regrtest.patch
keywords: patch
messages: 233298
nosy: haypo
priority: normal
severity: normal
status: open
title: regrtest: log test loader errors
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37583/regrtest.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23145>
_______________________________________


More information about the New-bugs-announce mailing list