summaryrefslogtreecommitdiffstats
path: root/Lib/unittest
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-05-08 13:23:31 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-05-08 13:23:31 (GMT)
commit161b024b6d2e68295e89f24837a27da599638ea2 (patch)
tree2a21bf4344fbd21bf4a7e4c53d9dc3c612ae1089 /Lib/unittest
parent099e45674cab56b39787bbbeeff5611905922aa9 (diff)
downloadcpython-161b024b6d2e68295e89f24837a27da599638ea2.zip
cpython-161b024b6d2e68295e89f24837a27da599638ea2.tar.gz
cpython-161b024b6d2e68295e89f24837a27da599638ea2.tar.bz2
Merged revisions 80974 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80974 | michael.foord | 2010-05-08 15:20:07 +0200 (Sat, 08 May 2010) | 1 line Issue 7780. Adding a test for unittest test discovery from a dotted path. ........
Diffstat (limited to 'Lib/unittest')
-rw-r--r--Lib/unittest/test/test_discovery.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py
index ad86a42..aa16b17 100644
--- a/Lib/unittest/test/test_discovery.py
+++ b/Lib/unittest/test/test_discovery.py
@@ -337,5 +337,22 @@ class TestDiscovery(unittest.TestCase):
self.assertEqual(sys.path[0], full_path)
+ def test_discovery_from_dotted_path(self):
+ loader = unittest.TestLoader()
+
+ tests = [self]
+ expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
+
+ self.wasRun = False
+ def _find_tests(start_dir, pattern):
+ self.wasRun = True
+ self.assertEqual(start_dir, expectedPath)
+ return tests
+ loader._find_tests = _find_tests
+ suite = loader.discover('unittest.test')
+ self.assertTrue(self.wasRun)
+ self.assertEqual(suite._tests, tests)
+
+
if __name__ == '__main__':
unittest.main()