Lines Matching refs:Loader
13 loader = unittest.TestLoader()
15 loader._top_level_dir = '/foo'
16 name = loader._get_name_from_path('/foo/bar/baz.py')
24 loader._get_name_from_path('/bar/baz.py')
27 loader = unittest.TestLoader()
56 loader._get_module_from_name = lambda path: path + ' module'
57 loader.loadTestsFromModule = lambda module: module + ' tests'
60 loader._top_level_dir = top_level
61 suite = list(loader._find_tests(top_level, 'test*.py'))
70 loader = unittest.TestLoader()
101 def load_tests(loader, tests, pattern):
102 self.load_tests_args.append((loader, tests, pattern))
112 loader._get_module_from_name = lambda name: Module(name)
117 loader.loadTestsFromModule = loadTestsFromModule
119 loader._top_level_dir = '/foo'
122 suite = list(loader._find_tests('/foo', 'test*'))
130 # load_tests should have been called once with loader, tests and pattern
132 [(loader, 'test_directory' + ' module tests', 'test*')])
135 loader = unittest.TestLoader()
152 loader.discover('/foo/bar', top_level_dir='/foo')
154 self.assertEqual(loader._top_level_dir, full_path)
168 loader._find_tests = _find_tests
169 loader.suiteClass = str
171 suite = loader.discover('/foo/bar/baz', 'pattern', '/foo/bar')
176 self.assertEqual(loader._top_level_dir, top_level_dir)
181 loader = unittest.TestLoader()
194 suite = loader.discover('.')
234 class Loader(object):
240 program.testLoader = Loader()
242 self.assertEqual(Loader.args, [('.', 'test*.py', None)])
247 class Loader(object):
253 program._do_discovery(['-v'], Loader=Loader)
256 self.assertEqual(Loader.args, [('.', 'test*.py', None)])
258 Loader.args = []
260 program._do_discovery(['--verbose'], Loader=Loader)
262 self.assertEqual(Loader.args, [('.', 'test*.py', None)])
264 Loader.args = []
266 program._do_discovery([], Loader=Loader)
268 self.assertEqual(Loader.args, [('.', 'test*.py', None)])
270 Loader.args = []
272 program._do_discovery(['fish'], Loader=Loader)
274 self.assertEqual(Loader.args, [('fish', 'test*.py', None)])
276 Loader.args = []
278 program._do_discovery(['fish', 'eggs'], Loader=Loader)
280 self.assertEqual(Loader.args, [('fish', 'eggs', None)])
282 Loader.args = []
284 program._do_discovery(['fish', 'eggs', 'ham'], Loader=Loader)
286 self.assertEqual(Loader.args, [('fish', 'eggs', 'ham')])
288 Loader.args = []
290 program._do_discovery(['-s', 'fish'], Loader=Loader)
292 self.assertEqual(Loader.args, [('fish', 'test*.py', None)])
294 Loader.args = []
296 program._do_discovery(['-t', 'fish'], Loader=Loader)
298 self.assertEqual(Loader.args, [('.', 'test*.py', 'fish')])
300 Loader.args = []
302 program._do_discovery(['-p', 'fish'], Loader=Loader)
304 self.assertEqual(Loader.args, [('.', 'fish', None)])
308 Loader.args = []
311 Loader=Loader)
313 self.assertEqual(Loader.args, [('fish', 'eggs', None)])
349 loader = unittest.TestLoader()
356 ImportError, '^%s$' % msg, loader.discover,
378 loader = unittest.TestLoader()
379 loader.discover(start_dir='foo', pattern='foo.py')
382 loader = unittest.TestLoader()
392 loader._find_tests = _find_tests
393 suite = loader.discover('unittest.test')