Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sub module named setup causes unexpected error in Nose #24

Open
jpellerin opened this issue Dec 14, 2011 · 6 comments
Open

sub module named setup causes unexpected error in Nose #24

jpellerin opened this issue Dec 14, 2011 · 6 comments
Assignees

Comments

@jpellerin
Copy link
Member

What steps will reproduce the problem?

  1. create mypackage with a submodule mypackage.setup
  2. create tests in mypackage.tests
  3. run nosetests from the top level directory

What is the expected output? What do you see instead?

Nose somehow thinks that the setup module is a package level fixture and
setting setup.test = False does not prevent this.

Attached is a simple test suite that reproduces the problem.

Please use labels and text to provide additional information.

Google Code Info:
Issue #: 326
Author: kumar.mcmillan
Created On: 2010-03-12T19:55:33.000Z
Closed On:

@jpellerin
Copy link
Member Author

last change ate my attachment. Here is the test suite again.

Google Code Info:
Author: kumar.mcmillan
Created On: 2010-03-12T19:56:04.000Z

@ghost ghost assigned jpellerin Dec 14, 2011
@jpellerin
Copy link
Member Author

After discussion on mailing list, this should be a feature / enhancement.

Allow anything named setup (or teardown) to be ignored with test=False

Google Code Info:
Author: kumar.mcmillan
Created On: 2010-03-13T22:47:53.000Z

@jpellerin
Copy link
Member Author

Issue 320 has been merged into this issue.

Google Code Info:
Author: [email protected]
Created On: 2011-11-25T05:35:44.000Z

@jpellerin
Copy link
Member Author

The workaround is to monkey-patch ContextSuitee:

ContextSuite.moduleSetup = ('setup_module', 'setupModule', 'setUpModule', 'setupHolder', 'setUp')

See:
http://hustoknow.blogspot.com/2011/02/setting-up-django-nose-on-hudson.html

Google Code Info:
Author: [email protected]
Created On: 2011-11-28T08:53:37.000Z

@kyleabeauchamp
Copy link

I wanted to ping to see if people have come up with improved workarounds for this issue.

@wpietri
Copy link

wpietri commented May 26, 2015

I'm new to nose and I'm struggling to apply the workaround described above. I've also tried fiddling with various command-line options in hopes of excluding the troublesome module, but with no luck. I'll have a hard time persuading my new colleagues of the virtue of continuously running the tests if they get spurious errors, so I'd appreciate any tips.

wpietri added a commit to codeforamerica/chime that referenced this issue May 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants