我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用test.test_doctest2()。
def test_main(): from test import test_doctest2 EXPECTED = 19 f, t = support.run_doctest(test_doctest2) if t != EXPECTED: raise support.TestFailed("expected %d tests to run, not %d" % (EXPECTED, t)) # Pollute the namespace with a bunch of imported functions and classes, # to make sure they don't get tested.
def test_main(): from test import test_doctest2 EXPECTED = 19 f, t = test_support.run_doctest(test_doctest2) if t != EXPECTED: raise test_support.TestFailed("expected %d tests to run, not %d" % (EXPECTED, t)) # Pollute the namespace with a bunch of imported functions and classes, # to make sure they don't get tested.