summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2016-02-01 00:05:30 +0300
committerDmitry Shachnev <mitya57@gmail.com>2016-02-01 00:05:30 +0300
commit8e7ad3d50012688ca029d126cbc88251831fea88 (patch)
treec07d16ed1cc50da9eb83f911048397aaf573dd18
parent6e11bf997b137fdfdd1b5acb537b5d85dee2013c (diff)
downloadnose-8e7ad3d50012688ca029d126cbc88251831fea88.tar.gz
Set __qualname__ equal to __name__ on derived classes
To make output on Python ≥ 3.5 the same as on previous Python versions. This fixes #928.
-rw-r--r--functional_tests/test_load_tests_from_test_case.py1
-rw-r--r--nose/util.py1
-rw-r--r--unit_tests/test_xunit.py1
3 files changed, 3 insertions, 0 deletions
diff --git a/functional_tests/test_load_tests_from_test_case.py b/functional_tests/test_load_tests_from_test_case.py
index 42f8563..13d0c8a 100644
--- a/functional_tests/test_load_tests_from_test_case.py
+++ b/functional_tests/test_load_tests_from_test_case.py
@@ -29,6 +29,7 @@ class NoFixturePlug(Plugin):
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()
diff --git a/nose/util.py b/nose/util.py
index bfe1658..80ab1d4 100644
--- a/nose/util.py
+++ b/nose/util.py
@@ -643,6 +643,7 @@ def transplant_class(cls, module):
pass
C.__module__ = module
C.__name__ = cls.__name__
+ C.__qualname__ = cls.__name__
return C
diff --git a/unit_tests/test_xunit.py b/unit_tests/test_xunit.py
index 944d285..261436b 100644
--- a/unit_tests/test_xunit.py
+++ b/unit_tests/test_xunit.py
@@ -16,6 +16,7 @@ def mktest():
class TC(unittest.TestCase):
def runTest(self):
pass
+ TC.__qualname__ = TC.__name__
test = TC()
return test