14

I want to use nose.collector as a test suite for setuptools, as described here. My package's source lives in mypackage/src, and I have tests in mypackage/tests. I have a setup.py that looks like this:

import setuptools

setuptools.setup(
    name='mypackage',
    version='1.2.3',
    package_dir={'': 'src'},
    packages=setuptools.find_packages('src'),
    tests_require=['nose'],
    test_suite='nose.collector',
    provides=setuptools.find_packages('src'),
)

However, when I run python setup.py test, it doesn't test anything:

$ python setup.py test
running test
running egg_info
writing src/mypackage.egg-info/PKG-INFO
writing top-level names to src/mypackage.egg-info/top_level.txt
writing dependency_links to src/mypackage.egg-info/dependency_links.txt
reading manifest file 'src/mypackage.egg-info/SOURCES.txt'
writing manifest file 'src/mypackage.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.002s

OK

How can I tell nose where to look for tests? Up until now, I've been doing nosetests -d tests, which works fine. But I'd like to change to use setuptools so that I can follow the python setup.py test convention.

limp_chimp
  • 13,475
  • 17
  • 66
  • 105

2 Answers2

1

from the docs

When running under setuptools, you can configure nose settings via the environment variables detailed in the nosetests script usage message, or the setup.cfg, ~/.noserc or ~/.nose.cfg config files.

http://nose.readthedocs.org/en/latest/setuptools_integration.html

maazza
  • 7,016
  • 15
  • 63
  • 96
0

Fix them with chmod -x $(find tests/ -name '*.py')

Mohamed
  • 836
  • 1
  • 13
  • 23