|
logilab-common #9384 adapt to unittest2 / discover [validation pending]It looks like http://pypi.python.org/pypi/discover will be part of the stdlib for python2.7 and python3.2. I suppose that would deprecate logilab.common.testlib's own test discovery mechanism.
| | priority | important |
|---|
| type | enhancement |
|---|
| appeared in | <not specified> |
|---|
| done in | 0.54.0 |
|---|
| load | 5.000 |
|---|
| load left | 0.000 |
|---|
| closed by | <not specified> |
|---|
Workflow history| from state (4) | to state | comment | date | User |
| done | validation pending | | 2011/01/13 21:35 | sthenault |
| open | done | | 2011/01/13 21:34 | sthenault |
| waiting feedback | open | | 2011/01/13 21:34 | sthenault |
| open | waiting feedback | we can mimick pytest command usage by using this shell function:
runtests() {
directory=$(dirname ${1:-"."})
[[ "$directory" = "." ]] && directory="test"
unit2 discover -s $directory -p $(basename ${1:-'*test*.py'})
}
Not perfect but should be enough usable.
You can pass a filepath to this function lilke pytest:
$ runtests
unit2 discover -s test -p pytest.py testlib.py
$ runtests test/unittest_cache.py
unit2 discover -s test -p unittest_cache.py
$ runtests unittest_cache.py
unit2 discover -s test -p unittest_cache.py # test directory by default
| 2010/11/30 11:55 | |
| |
|
Comments
-
2010/03/09 15:48, written by adimascio
| reply to this comment
-
2010/09/28 14:29, written by sthenault
| reply to this comment
(add comment)http://pypi.python.org/pypi/unittest2 is the new unittest implementation, available for python2.7 and python3.2 and usable as a standalone module for prior versions.
lgc 0.52 started unittest2 integration, on the path before removal...