summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/test_program.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/test/test_program.py')
-rw-r--r--Lib/unittest/test/test_program.py17
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()