我试图在我的包上运行py.test
,但它试图从项目根目录中解析setup.py
,即使我试图排除它。尝试运行py.test时收集setup.py时出错?
我需要从* .py文件收集测试,因为测试类包含在模块中。
# setup.cfg
[pytest]
norecursedirs = .svn _build tmp* lib/third lib *.egg bin distutils setup.py
python_files = *.py
不过当我运行py.test
它会给我ERROR collecting setup.py
,我已经排除。
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py:140: in setup
> raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
E SystemExit: usage: py.test [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
E or: py.test --help [cmd1 cmd2 ...]
E or: py.test --help-commands
E or: py.test cmd --help
E
E error: no commands supplied
该死的,这意味着如果我有另一个'setup.py',它也会被包含在内。另外,tox无法在父目录中查找tox.ini ?! – sorin
为了避免包含其他setup.py文件,我认为pytest.ini需要一种方法来允许指定像--ignore = {inidir} /setup.py这样的确切位置。 – hpk42