Lines Matching refs:tests
568 # This lets us sort tests by name:
839 will include tests for objects with empty docstrings.
867 This is obscure, of use mostly in tests: if `module` is False, or
939 tests = []
940 self._find(tests, obj, name, module, source_lines, globs, {})
941 # Sort the tests by alpha order of names, for consistency in
945 tests.sort()
946 return tests
988 def _find(self, tests, obj, name, module, source_lines, globs, seen):
990 Find tests for the given object and any contained objects, and
991 add them to `tests`.
994 print('Finding tests in %s' % name)
1001 # Find a test for this object, and add it to the list of tests.
1004 tests.append(test)
1006 # Look for tests in a module's contained objects.
1014 self._find(tests, val, valname, module, source_lines,
1017 # Look for tests in a module's __test__ dictionary.
1031 self._find(tests, val, valname, module, source_lines,
1034 # Look for tests in a class's contained objects.
1046 self._find(tests, val, valname, module, source_lines,
1150 >>> tests = DocTestFinder().find(_TestClass)
1152 >>> tests.sort(key = lambda test: test.name)
1153 >>> for test in tests:
1165 4 items passed all tests:
1166 2 tests in _TestClass
1167 2 tests in _TestClass.__init__
1168 2 tests in _TestClass.get
1169 1 tests in _TestClass.square
1170 7 tests in 4 items.
1543 print(len(notests), "items had no tests:")
1548 print(len(passed), "items passed all tests:")
1551 print(" %3d tests in %s" % (count, thing))
1559 print(totalt, "tests in", len(self._name2ft), "items.")
1768 r"""Run doc tests but raise an exception as soon as there is a failure.
1895 Return (#failures, #tests).
1916 detailed, else very brief (in fact, empty if all tests passed).
1962 # Find, parse, and run all tests in the given module.
1988 Test examples in the given file. Return (#failures, #tests).
2029 detailed, else very brief (in fact, empty if all tests passed).
2050 subclass) that should be used to extract tests from the files.
2123 # Find, parse, and run all tests in the given module.
2346 return "Skipping tests from %s" % self.module.__name__
2360 Convert doctest tests for a module to a unittest test suite.
2363 contains doctest tests to a unittest test case. If any of the
2364 tests in a doc string fail, then the test case fails. An exception
2377 tests in each file. The setUp function will be passed a DocTest
2383 tests in each file. The tearDown function will be passed a DocTest
2388 A dictionary containing initial global variables for the tests.
2398 tests = test_finder.find(module, globs=globs, extraglobs=extraglobs)
2400 if not tests and sys.flags.optimize >=2:
2406 tests.sort()
2409 for test in tests:
2493 tests in each file. The setUp function will be passed a DocTest
2499 tests in each file. The tearDown function will be passed a DocTest
2504 A dictionary containing initial global variables for the tests.
2511 tests from the files.
2620 with the doc string with tests to be debugged.
2623 tests = DocTestFinder().find(module)
2624 test = [t for t in tests if t.name == name]
2626 raise ValueError(name, "not found in tests")
2661 with the docstring with tests to be debugged.
2770 help='print very verbose output for all tests')
2777 help=('stop running tests after first failure (this'
2781 help='file containing the tests to run')