Title: unittest: allow an 'import_path' as an alternative to 'top_level_dir' in test discover
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.2
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: michael.foord Nosy List: michael.foord, r.david.murray
Priority: normal Keywords:

Created on 2010-01-25 22:31 by r.david.murray, last changed 2010-05-08 15:12 by michael.foord. This issue is now closed.

Messages (5)
msg98302 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-01-25 22:31
It would be nice if could take an argument that specifies the path to use to import the discovered tests, as an alternative to having to specify top_level_dir.
msg98925 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-02-06 00:31
My suggestion is that test discovery should first try the argument as a directory. If that fails try it as a dotted name by importing it. If the import succeeds discovery can start from the directory containing the imported package.

If a module rather than a package is specified as a dotted name argument to test discovery then we can either just run the tests in that module or raise an error?
msg102215 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-04-03 01:17
Committed revision 79643. Needs test and documentation.
msg105288 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-05-08 13:20
Test committed revision 80974.
msg105296 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-05-08 15:12
Documented revision 80980.
Date User Action Args
2010-05-08 15:12:10michael.foordsetstatus: open -> closed

messages: + msg105296
stage: resolved
2010-05-08 13:20:45michael.foordsetmessages: + msg105288
2010-05-08 13:16:28michael.foordsetmessages: - msg105287
2010-05-08 13:15:35michael.foordsetmessages: + msg105287
2010-04-03 01:17:25michael.foordsetresolution: accepted
messages: + msg102215
2010-02-06 00:31:24michael.foordsetmessages: + msg98925
2010-01-25 22:31:27r.david.murraycreate