Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0f4520d
wip: fix doctest
matrixise Oct 11, 2018
36ed172
fix doctest for library/re.rst
matrixise Oct 11, 2018
cc14274
use .. doctest:: instead of .. testcode:: because we need to keep the…
matrixise Oct 11, 2018
01dea04
Add testsetup
matrixise Oct 11, 2018
068485a
pass from 258 to 240
matrixise Oct 11, 2018
cd14acb
add SomeClass in testsetup -> 235 tests failed
matrixise Oct 11, 2018
9407247
update
matrixise Oct 11, 2018
249ff3d
update
matrixise Oct 11, 2018
c9d6175
add new target in travis
matrixise Oct 11, 2018
1fa9509
fix the whitespace
matrixise Oct 11, 2018
305ee74
try to use 3.7
matrixise Oct 11, 2018
1517a37
disable the warnings into errors
matrixise Oct 11, 2018
7c03c41
use a block code instead of doctest
matrixise Oct 11, 2018
2e1db29
Disable some builds
matrixise Oct 11, 2018
21b3db0
Fix with ellipsis
matrixise Oct 11, 2018
526f366
Disable the quiet flag of sphinx
matrixise Oct 11, 2018
5764cdb
Merge the tests and execute doctests just after the build
matrixise Oct 11, 2018
e500b59
Execute the doctests with the tests
matrixise Oct 11, 2018
1312c42
reset
matrixise Oct 11, 2018
a12dbe7
execute doctest
matrixise Oct 11, 2018
0ed453b
Execute doctest just after the tests
matrixise Oct 11, 2018
be41d1c
pin the version of sphinx
matrixise Oct 11, 2018
f8238a4
Reuse >>> for the doctests
matrixise Oct 11, 2018
e5f6478
Pass the tests if tkinter is not installed
matrixise Oct 11, 2018
9d14da2
Rename duplicated ref to a new ref
matrixise Oct 11, 2018
bece51b
Use the last version of sphinx
matrixise Oct 11, 2018
8263dee
Add News entry
matrixise Oct 11, 2018
e47a624
fix typo: seperately -> separately
matrixise Oct 11, 2018
40f850c
fix ': ::' to '::'
matrixise Oct 11, 2018
9505f06
fix the indentation of a function
matrixise Oct 11, 2018
7d76ead
reindent with the previous indentation, tab 4
matrixise Oct 11, 2018
93734d8
supress a useless diff
matrixise Oct 11, 2018
0511ae1
supress a useless diff
matrixise Oct 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ matrix:
- cd Doc
# Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
# (Updating the version is fine as long as no warnings are raised by doing so.)
# The theme used by the docs is stored seperately, so we need to install that as well.
- python -m pip install sphinx~=1.6.1 blurb python-docs-theme
# The theme used by the docs is stored separately, so we need to install that as well.
- python -m pip install sphinx blurb python-docs-theme
script:
- make check suspicious html SPHINXOPTS="-q -W -j4"
- os: osx
Expand Down Expand Up @@ -155,8 +155,14 @@ script:
# Check that all symbols exported by libpython start with "Py" or "_Py"
- make smelly
# `-r -w` implicitly provided through `make buildbottest`.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then XVFB_RUN=xvfb-run; fi; $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"

- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
XVFB_RUN=xvfb-run;
fi
$XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
$XVFB_RUN make PYTHON=../python SPHINXOPTS="-q -W -j4" -C Doc/ venv doctest
fi
notifications:
email: false
webhooks:
Expand Down
7 changes: 7 additions & 0 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest',
'pyspecific', 'c_annotations', 'escape4chm']


doctest_global_setup = '''
try:
import _tkinter
except ImportError:
_tkinter = None
'''
# General substitutions.
project = 'Python'
copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y')
Expand Down
2 changes: 1 addition & 1 deletion Doc/distutils/examples.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _examples:
.. _distutils_examples:

********
Examples
Expand Down
7 changes: 4 additions & 3 deletions Doc/library/multiprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -621,18 +621,19 @@ The :mod:`multiprocessing` package mostly replicates the API of the
Example usage of some of the methods of :class:`Process`:

.. doctest::
:options: +ELLIPSIS

>>> import multiprocessing, time, signal
>>> p = multiprocessing.Process(target=time.sleep, args=(1000,))
>>> print(p, p.is_alive())
<Process(Process-1, initial)> False
<Process(..., initial)> False
>>> p.start()
>>> print(p, p.is_alive())
<Process(Process-1, started)> True
<Process(..., started)> True
>>> p.terminate()
>>> time.sleep(0.1)
>>> print(p, p.is_alive())
<Process(Process-1, stopped[SIGTERM])> False
<Process(..., stopped[SIGTERM])> False
>>> p.exitcode == -signal.SIGTERM
True

Expand Down
13 changes: 6 additions & 7 deletions Doc/library/re.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1234,9 +1234,7 @@ Checking for a Pair
^^^^^^^^^^^^^^^^^^^

In this example, we'll use the following helper function to display match
objects a little more gracefully:

.. testcode::
objects a little more gracefully::

def displaymatch(match):
if match is None:
Expand Down Expand Up @@ -1269,10 +1267,9 @@ To match this with a regular expression, one could use backreferences as such::
"<Match: '354aa', groups=('a',)>"

To find out what card the pair consists of, one could use the
:meth:`~Match.group` method of the match object in the following manner:

.. doctest::
:meth:`~Match.group` method of the match object in the following manner::

>>> pair = re.compile(r".*(.).*\1")
>>> pair.match("717ak").group(1)
'7'

Expand Down Expand Up @@ -1377,7 +1374,9 @@ easily read and modified by Python as demonstrated in the following example that
creates a phonebook.

First, here is the input. Normally it may come from a file, here we are using
triple-quoted string syntax::
triple-quoted string syntax

.. doctest::

>>> text = """Ross McFluff: 834.345.1254 155 Elm Street
...
Expand Down
Loading