[docs] [issue11298] unittest discovery needs better explanation

blokeley report at bugs.python.org
Wed Feb 23 12:42:53 CET 2011


New submission from blokeley <blokeley at gmail.com>:

`python -m unittest discover` caught me out. 

I had a test module called `test-foo.py` and no test was loaded.

When I renamed to `test_foo.py` it worked.

The documentation says "For a project’s tests to be compatible with test discovery they must all be importable".

I didn't realise that test-foo would not be importable. Could the documentation say "For a project’s tests to be compatible with test discovery they must all be importable, so ensure that the module names are valid Python identifiers."

Stackoverflow question is here: http://stackoverflow.com/questions/5088960/python-unittest-discovery-does-not-discover-tests

----------
assignee: docs at python
components: Documentation
messages: 129176
nosy: blokeley, docs at python
priority: normal
severity: normal
status: open
title: unittest discovery needs better explanation
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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


More information about the docs mailing list