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

Fix TestCase loading with nested classes #51

Open
fornellas opened this issue Sep 27, 2019 · 0 comments
Open

Fix TestCase loading with nested classes #51

fornellas opened this issue Sep 27, 2019 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed Python Unittest

Comments

@fornellas
Copy link
Contributor

TestSlide loads TestCase classes using this logic. Upstream Python, does it like this. This means, that If the module has this:

class Outer:
  class Inner(TestCase):
    def test_something(self):
      pass

Python won't consider Inner.test_something as part of the test, but TestSlide will.

This can be easily fixed by refactoring the logic at TestSlide's side to match Python's, however, it won't cover other cases such as load_tests().

The proper fix for this, is to use Python's TestLoader in the same fashion as Python unittent does form its CLI.

@fornellas fornellas added bug Something isn't working help wanted Extra attention is needed labels Sep 27, 2019
@fornellas fornellas changed the title Fix TestCase loading Fix TestCase loading with nested classes Apr 8, 2020
@fornellas fornellas added this to the Python Unittest Integration milestone Apr 9, 2020
@fornellas fornellas removed this from the Python Unittest Integration milestone Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed Python Unittest
Projects
None yet
Development

No branches or pull requests

1 participant