ERROR collecting setup.py while trying to run py.test?
pytest, python, setuptools, tox
Solution
You can configure the --ignore option to your pytest.ini configuration like this maybe:
addopts = --ignore=setup.py
which should help if you are in the root directory and want py.test to ignore the setup.py file.
Problem
I am trying to run `py.test` on my package but it is trying to parse `setup.py` from the project root directory even if I tried to exclude it. I need to collect the tests from *.py files because the test classes are included in the modules. ``` # setup.cfg [pytest] norecursedirs = .svn _build tmp* lib/third lib *.egg bin distutils setup.py python_files = *.py ``` Still when I run `py.test` it will give me `ERROR collecting setup.py` which I already excluded. ``` /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 ```