Lines Matching refs:tests

26 # NOTE: There are some additional tests relating to interaction with
28 # There are also related tests in `test_doctest2` module.
186 Unit tests for the `Example` class.
307 Unit tests for the `DocTest` class.
441 Unit tests for the `DocTestFinder` class.
461 >>> tests = finder.find(sample_func)
463 >>> print(tests) # doctest: +ELLIPSIS
469 >>> tests[0].filename # doctest: +ELLIPSIS
475 >>> e = tests[0].examples[0]
479 By default, tests are created for objects with no docstring:
487 constructor can be used to exclude tests for objects with empty
498 about which functions have no tests -- but is that useful? And should
513 >>> tests = finder.find(SampleClass)
514 >>> for t in tests:
529 >>> tests = finder.find(SampleNewStyleClass)
530 >>> for t in tests:
568 >>> tests = finder.find(m, module=test.test_doctest)
569 >>> for t in tests:
588 If a single object is listed twice (under different names), then tests
594 >>> tests = excl_empty_finder.find(doctest_aliases)
595 >>> print(len(tests))
597 >>> print(tests[0].name)
604 >>> tests[1].name.split('.')[-1] in ['f', 'g']
609 By default, an object with no doctests doesn't create any tests:
611 >>> tests = doctest.DocTestFinder().find(SampleClass)
612 >>> for t in tests:
626 tells it to include (empty) tests for objects with no doctests. This feature
630 >>> tests = doctest.DocTestFinder(exclude_empty=False).find(SampleClass)
631 >>> for t in tests:
651 >>> tests = doctest.DocTestFinder(exclude_empty=False).find(doctest_lineno)
652 >>> for t in tests:
668 DocTestFinder can be told not to look for tests in contained objects
671 >>> tests = doctest.DocTestFinder(recurse=False).find(SampleClass)
672 >>> for t in tests:
711 >>> tests = doctest.DocTestFinder().find(builtins)
712 >>> 825 < len(tests) < 845 # approximate number of objects with docstrings
714 >>> real_tests = [t for t in tests if len(t.examples) > 0]
774 Unit tests for the `DocTestParser` class.
830 Unit tests for the `DocTestRunner` class.
847 `(f,t)`, where `f` is the number of failed tests and `t` is the number
848 of tried tests.
1874 Unit tests for `testsource()`.
2208 The DocTestFinder need not return any tests:
2282 """We can test tests found in text files using a DocFileSuite.
2428 containing the tests:
2434 If the tests contain non-ASCII characters, we have to specify which
2479 tests. They both fail if blank lines are disabled:
2514 If we give any reporting options when we set up the tests,
2556 calling module. The return value is (#failures, #tests).
2558 We don't want `-v` in sys.argv for these tests.
2581 `doctest.testfile`, to suppress warnings about multiple tests with the
2635 1 items passed all tests:
2636 2 tests in test_doctest.txt
2637 2 tests in 1 items.
2679 If the tests contain non-ASCII characters, the tests might fail, since
2718 1 items passed all tests:
2719 2 tests in test_doctest4.txt
2720 2 tests in 1 items.
2887 These tests test this CLI functionality.
2898 simple tests and no errors. We'll run both the unadorned doctest command, and
2918 With no arguments and passing tests, we should get no output:
2938 1 items passed all tests:
2939 2 tests in myfile.doc
2940 2 tests in 1 items.
2944 Now we'll write a couple files, one with three tests, the other a python module
2945 with two tests, both of the files having "errors" in the tests that can be made
3047 success output for the tests in both files:
3067 1 items passed all tests:
3068 3 tests in myfile.doc
3069 3 tests in 1 items.
3082 1 items had no tests:
3084 1 items passed all tests:
3085 2 tests in myfile2.test_func
3086 2 tests in 2 items.
3173 def load_tests(loader, tests, pattern):
3174 tests.addTest(doctest.DocTestSuite(doctest))
3175 tests.addTest(doctest.DocTestSuite())
3176 return tests