File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1818import contextlib
1919
2020
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
2327
2428
2529# NOTE: There are some additional tests relating to interaction with
@@ -466,7 +470,7 @@ def basics(): r"""
466470 >>> tests = finder.find(sample_func)
467471
468472 >>> 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)>]
470474
471475The exact name depends on how test_doctest was invoked, so allow for
472476leading path components.
@@ -2966,6 +2970,7 @@ def test_unicode(): """
29662970 TestResults(failed=1, attempted=1)
29672971 """
29682972
2973+ @doctest_skip_if (not support .has_subprocess_support )
29692974def test_CLI (): r"""
29702975The doctest module can be used to run doctests against an arbitrary file.
29712976These tests test this CLI functionality.
You can’t perform that action at this time.
0 commit comments