summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2013-02-11 00:18:07 (GMT)
committerMichael Foord <michael@voidspace.org.uk>2013-02-11 00:18:07 (GMT)
commita23a39c07d3027e5139cc6127783cab23ca1a511 (patch)
tree49977f033ba80417ba5144ef837e7e5bd852e637 /Lib/unittest/test
parentb4621899212f5f661ef5c25cd0b71f8b1ab39028 (diff)
parent8fd396bd227ba35e0da477e5eef70e85700f186c (diff)
downloadcpython-a23a39c07d3027e5139cc6127783cab23ca1a511.zip
cpython-a23a39c07d3027e5139cc6127783cab23ca1a511.tar.gz
cpython-a23a39c07d3027e5139cc6127783cab23ca1a511.tar.bz2
Merge
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/test_discovery.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py
index e688f8e..eba269f 100644
--- a/Lib/unittest/test/test_discovery.py
+++ b/Lib/unittest/test/test_discovery.py
@@ -253,12 +253,26 @@ class TestDiscovery(unittest.TestCase):
program = TestableTestProgram()
program.usageExit = usageExit
+ program.testLoader = None
with self.assertRaises(Stop):
# too many args
program._do_discovery(['one', 'two', 'three', 'four'])
+ def test_command_line_handling_do_discovery_uses_default_loader(self):
+ program = object.__new__(unittest.TestProgram)
+
+ class Loader(object):
+ args = []
+ def discover(self, start_dir, pattern, top_level_dir):
+ self.args.append((start_dir, pattern, top_level_dir))
+ return 'tests'
+
+ program.testLoader = Loader
+ program._do_discovery(['-v'])
+ self.assertEqual(Loader.args, [('.', 'test*.py', None)])
+
def test_command_line_handling_do_discovery_calls_loader(self):
program = TestableTestProgram()