• Home
  • Raw
  • Download

Lines Matching +full:module +full:- +full:path +full:- +full:tests

15   %(prog)s test_module               - run tests from test_module
16 %(prog)s module.TestClass - run tests from module.TestClass
17 %(prog)s module.Class.test_method - run specified test method
18 %(prog)s path/to/test_file.py - run tests from test_file.py
23 %(prog)s - run default set of tests
24 %(prog)s MyTestSuite - run suite 'MyTestSuite'
25 %(prog)s MyTestCase.testSomething - run MyTestCase.testSomething
26 %(prog)s MyTestCase - run all 'test*' test methods
34 # valid Python module name.
35 if os.path.isfile(name) and name.lower().endswith('.py'):
36 if os.path.isabs(name):
37 rel_path = os.path.relpath(name, os.getcwd())
38 if os.path.isabs(rel_path) or rel_path.startswith(os.pardir):
41 # on Windows both '\' and '/' are used as path
42 # separators. Better to replace both than rely on os.path.sep
43 return os.path.normpath(name)[:-3].replace('\\', '.').replace('/', '.')
57 """A command-line program that runs a set of tests; this is primarily
61 module=None variable in TestProgram
66 def __init__(self, module='__main__', defaultTest=None, argv=None, argument
70 if isinstance(module, str):
71 self.module = __import__(module)
72 for part in module.split('.')[1:]:
73 self.module = getattr(self.module, part)
75 self.module = module
88 # specified by the warnings arg or the -W python flag
95 # and depends on the values passed to -W.
100 self.progName = os.path.basename(argv[0])
115 if self.module is None:
125 if self.module is None:
130 if not self.tests:
131 # this allows "python -m unittest -v" to still work for
138 if self.tests:
139 self.testNames = _convert_names(self.tests)
141 # to support python -m unittest ...
142 self.module = None
144 # createTests will load tests from self.module
159 self.test = self.testLoader.loadTestsFromModule(self.module)
162 self.module)
172 parser.add_argument('-v', '--verbose', dest='verbosity',
175 parser.add_argument('-q', '--quiet', dest='verbosity',
178 parser.add_argument('--locals', dest='tb_locals',
182 parser.add_argument('-f', '--failfast', dest='failfast',
187 parser.add_argument('-c', '--catch', dest='catchbreak',
189 help='Catch Ctrl-C and display results so far')
192 parser.add_argument('-b', '--buffer', dest='buffer',
194 help='Buffer stdout and stderr during tests')
197 parser.add_argument('-k', dest='testNamePatterns',
199 help='Only run tests which match the given substring')
209 parser.add_argument('tests', nargs='*',
222 parser.add_argument('-s', '--start-directory', dest='start',
224 parser.add_argument('-p', '--pattern', dest='pattern',
225 help="Pattern to match tests ('test*.py' default)")
226 parser.add_argument('-t', '--top-level-directory', dest='top',