【发布时间】:2012-06-03 23:29:35
【问题描述】:
我试图在我的包上运行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
【问题讨论】:
标签: python setuptools pytest tox