user
user

Reputation: 5390

nosetests on underscore-prefixed modules

I have a directory structure

+ (project-root)
+- setup.py
+- setup.cfg
+-+ src/
  +- asdf.py
  +- asdf_test.py

and a directory structure

+ (project-root)
+- setup.py
+- setup.cfg
+-+ src/
  +- _asdf.py
  +- _asdf_test.py

In setup.py, I have:

setuptools.setup(
    name='project',
    description='',
    author='',
    author_email='',
    packages=setuptools.find_packages('src'),
    package_dir={'':'src'},
    setup_requires=['nose>=1.0'],
    test_suite='nose.collector'
)

The setup.cfg is empty in the above scenarios (devoid of any [nosetests] section).

The first directory structure's tests are run with python setup.py nosetests. The second directory structure's tests aren't. How do I make the second directory structure's tests run?

Upvotes: 0

Views: 173

Answers (2)

user
user

Reputation: 5390

By default --ignore-files is set up to ignore all _ prefixed files (see here). Setting it to --ignore-files='^$' makes everything happy and dandy.

Upvotes: 1

Matt
Matt

Reputation: 4989

Have you tried using the --match flag or a custom selector? Both of these methods are detailed in this post.

Upvotes: 0

Related Questions