This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients docs@python, eli.bendersky, georg.brandl, giampaolo.rodola, ncoghlan, sandro.tosi, terry.reedy
Date 2011-05-04.23:57:32
SpamBayes Score 0.0
Marked as misclassified No
Message-id <1304553453.71.0.570303940199.issue11015@psf.upfronthosting.co.za>
In-reply-to
Content
This is an improvement that I think should be committed before 3.2.1.
Some comments:

+.. function:: run_doctest(module, verbosity=None)
+   Run :mod:`doctest` on the given *module*.
should be, I believe,
+   Run :func:`doctest.testmod` on the given *module*.
as that is what the function actually does (I check the code).

+   If *verbosity* is :const:`None`, :meth:`doctest` is run with verbosity set
+   to :data:`verbose`.  Otherwise, it is run with verbosity set to
+   :const:`None`.

Should :meth:`doctest` be :func:`testmod` ?
Otherwise the proposed text rewrites

"    If optional argument verbosity is not specified (or is None), pass
    support's belief about verbosity on to doctest.  Else doctest's
    usual behavior is used (it searches sys.argv for -v)."

The problem with the rewrite is that the keyword param of testmod is 'verbose', not 'verbosity'. 'Verbosity' is a dummy name used to either pass support.verbose to verbose, or not. So testmod is, in net effect, run with verbose=verbose or verbose=None. My attempt to explain a bad design (with probable markup errors):

"If *verbosity* is :const:`None`, :func:`testmod` is run with verbose set to :data:`support.verbose`, which is set by :func:`regrtest`. Otherwise, it is run with verbose set to :const:`None` and subsequently replaced by :code:`'-v' in sys.argv`."


+.. function:: temp_umask(umask)
+
+   A context manager that temporarily sets the process umask to the
+   given value.

"sets the process umask to *umask*." ?


+.. function:: find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM)

+   Either this method or :func:`bind_port` should be used for any tests
+   where a server socket needs to be bound to a particular port for the
+   duration of the test.
+   Which one to use depends on whether the calling code is creating a python
+   socket, or if an unused port needs to be provided in a constructor
+   or passed to an external program (i.e. the ``-accept`` argument to
+   openssl's s_server mode). 

This is copied from the doc string but does really tell me which to use in which of the two situations.

Other additions look OK to me. Some copied docstrings (or comments). Some are new. Support.py could also use a patch to add missing docstings (and turn a couple of comments into docstrings).
History
Date User Action Args
2011-05-04 23:57:33terry.reedysetrecipients: + terry.reedy, georg.brandl, ncoghlan, giampaolo.rodola, eli.bendersky, sandro.tosi, docs@python
2011-05-04 23:57:33terry.reedysetmessageid: <1304553453.71.0.570303940199.issue11015@psf.upfronthosting.co.za>
2011-05-04 23:57:33terry.reedylinkissue11015 messages
2011-05-04 23:57:32terry.reedycreate