Skip to content

Commit

Permalink
Set __qualname__ equal to __name__ on derived classes
Browse files Browse the repository at this point in the history
To make output on Python ≥ 3.5 the same as on previous Python versions.

This fixes #928.
  • Loading branch information
mitya57 committed Jan 31, 2016
1 parent 6e11bf9 commit 8e7ad3d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions functional_tests/test_load_tests_from_test_case.py
Expand Up @@ -29,6 +29,7 @@ def setUp(self):
pass
def tearDown(self):
pass
Derived.__qualname__ = Derived.__name__
# must use nose loader here because the default loader in 2.3
# won't load tests from base classes
l = loader.TestLoader()
Expand Down
1 change: 1 addition & 0 deletions nose/util.py
Expand Up @@ -643,6 +643,7 @@ class C(cls):
pass
C.__module__ = module
C.__name__ = cls.__name__
C.__qualname__ = cls.__name__
return C


Expand Down
1 change: 1 addition & 0 deletions unit_tests/test_xunit.py
Expand Up @@ -16,6 +16,7 @@ def mktest():
class TC(unittest.TestCase):
def runTest(self):
pass
TC.__qualname__ = TC.__name__
test = TC()
return test

Expand Down

0 comments on commit 8e7ad3d

Please sign in to comment.