Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA: Don't hide doctest output #95436

Merged
merged 7 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
5 changes: 5 additions & 0 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
import _tkinter
except ImportError:
_tkinter = None
# Treat warnings as errors, done here to prevent warnings in Sphinx code from
# causing spurious test failures.
import warnings
warnings.simplefilter('error')
del warnings
'''

manpages_url = 'https://manpages.debian.org/{path}'
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Number-theoretic and representation functions
.. function:: fsum(iterable)

Return an accurate floating point sum of values in the iterable. Avoids
loss of precision by tracking multiple intermediate partial sums::
loss of precision by tracking multiple intermediate partial sums:

>>> sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])
0.9999999999999999
Expand Down Expand Up @@ -371,7 +371,7 @@ Power and logarithmic functions
logarithms. For small floats *x*, the subtraction in ``exp(x) - 1``
can result in a `significant loss of precision
<https://en.wikipedia.org/wiki/Loss_of_significance>`_\; the :func:`expm1`
function provides a way to compute this quantity to full precision::
function provides a way to compute this quantity to full precision:

>>> from math import exp, expm1
>>> exp(1e-5) - 1 # gives result accurate to 11 places
Expand Down Expand Up @@ -654,7 +654,7 @@ Constants
not considered to equal to any other numeric value, including themselves. To check
whether a number is a NaN, use the :func:`isnan` function to test
for NaNs instead of ``is`` or ``==``.
Example::
Example:

>>> import math
>>> math.nan == math.nan
Expand Down
14 changes: 14 additions & 0 deletions Doc/library/nntplib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@
.. deprecated:: 3.11
The :mod:`nntplib` module is deprecated (see :pep:`594` for details).

.. testsetup::

import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore', category=DeprecationWarning)
import nntplib
erlend-aasland marked this conversation as resolved.
Show resolved Hide resolved

.. testcleanup::

try:
s.quit()
except NameError:
pass

--------------

This module defines the class :class:`NNTP` which implements the client side of
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/turtle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ Appearance
(direction of movement).

.. doctest::
:skipif: _tkinter is None
:skipif: _tkinter is None or 'always; deprecated method'

>>> turtle.reset()
>>> turtle.shape("circle")
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,15 @@ aspects that are visible to the programmer:
* The tag that is unique to each interpreter is accessible from the :mod:`imp`
module:

>>> import imp
>>> import imp # doctest: +SKIP
>>> imp.get_tag() # doctest: +SKIP
'cpython-32'

* Scripts that try to deduce source filename from the imported file now need to
be smarter. It is no longer sufficient to simply strip the "c" from a ".pyc"
filename. Instead, use the new functions in the :mod:`imp` module:

>>> imp.source_from_cache('c:/py32/lib/__pycache__/collections.cpython-32.pyc')
>>> imp.source_from_cache('c:/py32/lib/__pycache__/collections.cpython-32.pyc') # doctest: +SKIP
'c:/py32/lib/collections.py'
>>> imp.cache_from_source('c:/py32/lib/collections.py') # doctest: +SKIP
'c:/py32/lib/__pycache__/collections.cpython-32.pyc'
Expand Down