LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """ | 2 """ |
3 Test script for doctest. | 3 Test script for doctest. |
4 """ | 4 """ |
5 | 5 |
6 import sys | 6 import sys |
7 from test import test_support | 7 from test import test_support |
8 import doctest | 8 import doctest |
9 | 9 |
10 # NOTE: There are some additional tests relating to interaction with | 10 # NOTE: There are some additional tests relating to interaction with |
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 def test_trailing_space_in_test(): | 2058 def test_trailing_space_in_test(): |
2059 """ | 2059 """ |
2060 Trailing spaces in expected output are significant: | 2060 Trailing spaces in expected output are significant: |
2061 | 2061 |
2062 >>> x, y = 'foo', '' | 2062 >>> x, y = 'foo', '' |
2063 >>> print x, y | 2063 >>> print x, y |
2064 foo \n | 2064 foo \n |
2065 """ | 2065 """ |
2066 | 2066 |
2067 def test_tabs_in_test(): | 2067 def test_tabs_in_test(): |
2068 """ | 2068 r""" |
2069 Tabs are expanded correctly: | 2069 Tabs are expanded correctly: |
2070 | 2070 |
2071 >>> print "\tx" | 2071 >>> print "\tx" |
2072 x | 2072 x |
2073 """ | 2073 """ |
2074 | 2074 |
2075 def test_unittest_reportflags(): | 2075 def test_unittest_reportflags(): |
2076 """Default unittest reporting flags can be set to control reporting | 2076 """Default unittest reporting flags can be set to control reporting |
2077 | 2077 |
2078 Here, we'll set the REPORT_ONLY_FIRST_FAILURE option so we see | 2078 Here, we'll set the REPORT_ONLY_FIRST_FAILURE option so we see |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 r = tracer.results() | 2483 r = tracer.results() |
2484 print 'Writing coverage results...' | 2484 print 'Writing coverage results...' |
2485 r.write_results(show_missing=True, summary=True, | 2485 r.write_results(show_missing=True, summary=True, |
2486 coverdir=coverdir) | 2486 coverdir=coverdir) |
2487 | 2487 |
2488 if __name__ == '__main__': | 2488 if __name__ == '__main__': |
2489 if '-c' in sys.argv: | 2489 if '-c' in sys.argv: |
2490 test_coverage('/tmp/doctest.cover') | 2490 test_coverage('/tmp/doctest.cover') |
2491 else: | 2491 else: |
2492 test_main() | 2492 test_main() |
LEFT | RIGHT |