Kaydet (Commit) 57dfb227 authored tarafından Ezio Melotti's avatar Ezio Melotti

#16154: fix some doctests in Doc/library. Patch by Ravi Sinha.

üst 5c4e32b1
...@@ -58,7 +58,7 @@ The :mod:`colorsys` module defines the following functions: ...@@ -58,7 +58,7 @@ The :mod:`colorsys` module defines the following functions:
Example:: Example::
>>> import colorsys >>> import colorsys
>>> colorsys.rgb_to_hsv(.3, .4, .2) >>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4)
(0.25, 0.5, 0.4) (0.5, 0.5, 0.4)
>>> colorsys.hsv_to_rgb(0.25, 0.5, 0.4) >>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)
(0.3, 0.4, 0.2) (0.2, 0.4, 0.4)
...@@ -54,9 +54,9 @@ The :mod:`filecmp` module defines the following functions: ...@@ -54,9 +54,9 @@ The :mod:`filecmp` module defines the following functions:
Example:: Example::
>>> import filecmp >>> import filecmp
>>> filecmp.cmp('undoc.rst', 'undoc.rst') >>> filecmp.cmp('undoc.rst', 'undoc.rst') # doctest: +SKIP
True True
>>> filecmp.cmp('undoc.rst', 'index.rst') >>> filecmp.cmp('undoc.rst', 'index.rst') # doctest: +SKIP
False False
...@@ -190,6 +190,6 @@ recursively through two directories to show common different files:: ...@@ -190,6 +190,6 @@ recursively through two directories to show common different files::
... for sub_dcmp in dcmp.subdirs.values(): ... for sub_dcmp in dcmp.subdirs.values():
... print_diff_files(sub_dcmp) ... print_diff_files(sub_dcmp)
... ...
>>> dcmp = dircmp('dir1', 'dir2') >>> dcmp = dircmp('dir1', 'dir2') # doctest: +SKIP
>>> print_diff_files(dcmp) >>> print_diff_files(dcmp) # doctest: +SKIP
...@@ -82,6 +82,8 @@ Number-theoretic and representation functions ...@@ -82,6 +82,8 @@ Number-theoretic and representation functions
.. function:: fsum(iterable) .. function:: fsum(iterable)
.. testsetup::
>>> from math import fsum
Return an accurate floating point sum of values in the iterable. Avoids 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::
......
...@@ -717,7 +717,7 @@ Here is an example of how to use a Template: ...@@ -717,7 +717,7 @@ Here is an example of how to use a Template:
>>> Template('Give $who $100').substitute(d) >>> Template('Give $who $100').substitute(d)
Traceback (most recent call last): Traceback (most recent call last):
[...] [...]
ValueError: Invalid placeholder in string: line 1, col 10 ValueError: Invalid placeholder in string: line 1, col 11
>>> Template('$who likes $what').substitute(d) >>> Template('$who likes $what').substitute(d)
Traceback (most recent call last): Traceback (most recent call last):
[...] [...]
......
...@@ -923,6 +923,7 @@ Michael Simcich ...@@ -923,6 +923,7 @@ Michael Simcich
Ionel Simionescu Ionel Simionescu
Kirill Simonov Kirill Simonov
Nathan Paul Simons Nathan Paul Simons
Ravi Sinha
Janne Sinkkonen Janne Sinkkonen
Ng Pheng Siong Ng Pheng Siong
George Sipe George Sipe
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment