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

nosedep causes all ancestor unites classes to be executed #13

Open
chickenandpork opened this issue Nov 12, 2018 · 4 comments
Open

nosedep causes all ancestor unites classes to be executed #13

chickenandpork opened this issue Nov 12, 2018 · 4 comments

Comments

@chickenandpork
Copy link

When testing #12, ran into another issue:

(based on decorated_functional_dep_skip, edited similar to #12, all depends removed, two descendent classes added)

from unittest import SkipTest, TestCase
  
class decorated_functional_dep_skip(TestCase):
    def test_dfds_a(self):
        pass

    def test_dfds_b(self):
        pass

    def test_dfds_c(self):
        pass

    def test_dfds_d(self):
        pass

    def test_dfds_e(self):
        pass

    def test_dfds_f(self):
        pass

class descendent1(decorated_functional_dep_skip):
    pass

class descendent2(descendent1):
    pass

Run with the following shows only 6 unittests as expected:

nosetests --no-byte-compile --with-xunit -v -s ./testfail.py:descendent1

Run with the --with-nosedep option, and now all ancestor and descendent classes (6 x 3 == 18 tests) also executed:

nosetests --no-byte-compile --with-nosedep --with-xunit -v -s ./testfail.py:descendent1

@Zitrax
Copy link
Owner

Zitrax commented Nov 12, 2018

Right, I have always ran all the tests so specifying the class has not been tested.

But I can reproduce the issue and will have a look.

Zitrax added a commit that referenced this issue Nov 17, 2018
When specifying a specific class on the command line we should not run the all
the ancestor unit tests.
@Zitrax
Copy link
Owner

Zitrax commented Nov 17, 2018

I have committed a fix for this as you can see above. I have not done much testing but it seem to solve this exact case though.

Can you check if it works for your use cases?

@chickenandpork
Copy link
Author

chickenandpork commented Nov 27, 2018 via email

@Zitrax
Copy link
Owner

Zitrax commented Nov 28, 2018

Ok that sounds good. I'll hold off releasing for a while then to see if something else shows up.

I am not using parameterized tests with nose, so I am unsure of the status of that.

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

2 participants