mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Merge
This commit is contained in:
commit
a23a39c07d
3 changed files with 21 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue