File tree 1 file changed +8
-3
lines changed 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 18
18
import contextlib
19
19
20
20
21
- if not support .has_subprocess_support :
22
- raise unittest .SkipTest ("test_CLI requires subprocess support." )
21
+ def doctest_skip_if (condition ):
22
+ def decorator (func ):
23
+ if condition and support .HAVE_DOCSTRINGS :
24
+ func .__doc__ = ">>> pass # doctest: +SKIP"
25
+ return func
26
+ return decorator
23
27
24
28
25
29
# NOTE: There are some additional tests relating to interaction with
@@ -466,7 +470,7 @@ def basics(): r"""
466
470
>>> tests = finder.find(sample_func)
467
471
468
472
>>> print(tests) # doctest: +ELLIPSIS
469
- [<DocTest sample_func from test_doctest.py:33 (1 example)>]
473
+ [<DocTest sample_func from test_doctest.py:37 (1 example)>]
470
474
471
475
The exact name depends on how test_doctest was invoked, so allow for
472
476
leading path components.
@@ -2966,6 +2970,7 @@ def test_unicode(): """
2966
2970
TestResults(failed=1, attempted=1)
2967
2971
"""
2968
2972
2973
+ @doctest_skip_if (not support .has_subprocess_support )
2969
2974
def test_CLI (): r"""
2970
2975
The doctest module can be used to run doctests against an arbitrary file.
2971
2976
These tests test this CLI functionality.
You can’t perform that action at this time.
0 commit comments