@@ -2355,12 +2355,7 @@ def test_unittest_reportflags():
2355
2355
Then the default eporting options are ignored:
2356
2356
2357
2357
>>> result = suite.run(unittest.TestResult())
2358
- """
2359
- """
2360
- *NOTE*: These doctest are intentionally not placed in raw string to depict
2361
- the trailing whitespace using `\x20 ` in the diff below.
2362
-
2363
- >>> print(result.failures[0][1]) # doctest: +ELLIPSIS
2358
+ >>> print result.failures[0][1] # doctest: +ELLIPSIS
2364
2359
Traceback ...
2365
2360
Failed example:
2366
2361
favorite_color
@@ -2373,7 +2368,7 @@ def test_unittest_reportflags():
2373
2368
Differences (ndiff with -expected +actual):
2374
2369
a
2375
2370
- <BLANKLINE>
2376
- +\x20
2371
+ +
2377
2372
b
2378
2373
<BLANKLINE>
2379
2374
<BLANKLINE>
@@ -2722,47 +2717,6 @@ def old_test4(): """
2722
2717
TestResults(failed=0, attempted=4)
2723
2718
"""
2724
2719
2725
- def test_no_trailing_whitespace_stripping ():
2726
- r"""
2727
- The fancy reports had a bug for a long time where any trailing whitespace on
2728
- the reported diff lines was stripped, making it impossible to see the
2729
- differences in line reported as different that differed only in the amount of
2730
- trailing whitespace. The whitespace still isn't particularly visible unless
2731
- you use NDIFF, but at least it is now there to be found.
2732
-
2733
- *NOTE*: This snippet was intentionally put inside a raw string to get rid of
2734
- leading whitespace error in executing the example below
2735
-
2736
- >>> def f(x):
2737
- ... r'''
2738
- ... >>> print('\n'.join(['a ', 'b']))
2739
- ... a
2740
- ... b
2741
- ... '''
2742
- """
2743
- """
2744
- *NOTE*: These doctest are not placed in raw string to depict the trailing whitespace
2745
- using `\x20 `
2746
-
2747
- >>> test = doctest.DocTestFinder().find(f)[0]
2748
- >>> flags = doctest.REPORT_NDIFF
2749
- >>> doctest.DocTestRunner(verbose=False, optionflags=flags).run(test)
2750
- ... # doctest: +ELLIPSIS
2751
- **********************************************************************
2752
- File ..., line 3, in f
2753
- Failed example:
2754
- print('\n '.join(['a ', 'b']))
2755
- Differences (ndiff with -expected +actual):
2756
- - a
2757
- + a
2758
- b
2759
- TestResults(failed=1, attempted=1)
2760
-
2761
- *NOTE*: `\x20 ` is for checking the trailing whitespace on the +a line above.
2762
- We cannot use actual spaces there, as a commit hook prevents from committing
2763
- patches that contain trailing whitespace. More info on Issue 24746.
2764
- """
2765
-
2766
2720
######################################################################
2767
2721
## Main
2768
2722
######################################################################
0 commit comments