diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-05-07 15:35:24 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-05-07 15:35:24 (GMT) |
commit | 4a8cf3c50b58c48ae5f08e2fad4e99a207d8553e (patch) | |
tree | dac7977ae6e86986b691653668d0f0cd39b0304f /Lib/unittest/test | |
parent | dd3820f2752bb63dbc5d56608c3814b1859a70c2 (diff) | |
download | cpython-4a8cf3c50b58c48ae5f08e2fad4e99a207d8553e.zip cpython-4a8cf3c50b58c48ae5f08e2fad4e99a207d8553e.tar.gz cpython-4a8cf3c50b58c48ae5f08e2fad4e99a207d8553e.tar.bz2 |
Merged revisions 80918 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r80918 | michael.foord | 2010-05-07 17:34:08 +0200 (Fri, 07 May 2010) | 1 line
Adding a test for unittest test discovery with dotted path name.
........
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r-- | Lib/unittest/test/test_program.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_program.py b/Lib/unittest/test/test_program.py index b6a69dc..752a066 100644 --- a/Lib/unittest/test/test_program.py +++ b/Lib/unittest/test/test_program.py @@ -1,10 +1,27 @@ import io +import os import unittest class Test_TestProgram(unittest.TestCase): + 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) + # Horrible white box test def testNoExit(self): result = object() |