[issue15939] make *.rst files in Doc/ parseable by doctest

2013-08-17 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
type:  - enhancement
versions:  -Python 3.2
Added file: http://bugs.python.org/file31339/issue15939-ctypes-2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

If they don't work I see no reasons to leave them there.
Either there's another way to run those tests on selected platforms that can be 
used instead, of if there's no way the tests should just be skipped.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

The attached patch fixes the doctests in Doc/library/ctypes.rst.

--
stage:  - patch review
versions: +Python 3.4
Added file: http://bugs.python.org/file27529/issue15939-ctypes.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 Either there's another way to run those tests on selected platforms that can 
 be used instead

A way to do it could be to register new doctest directives that skip the marked 
test based on the value of sys.platform.  If we remove the directives, we lose 
that information and won't be able to do it anymore.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

 A way to do it could be to register new doctest directives that skip
 the marked test based on the value of sys.platform.

That can be done for 3.4+ only though.

 If we remove the directives, we lose that information and won't
 be able to do it anymore.

It actually seems quite easy to distinguish them.  At the beginning 'libc' is 
created either using cdll.msvcrt (on windows) or CDLL(libc.so.6) (on Linux).  
There are examples that use windll and other Windows- or Linux-specific 
functions later on but it's usually quite evident.  If we get lost we can 
always dig in the history or just run the tests and see where they fail.

FTR there were a few actual errors that I fixed (mostly about bytes vs string). 
 I also removed unnecessary prints and added a few doctest directives to make 
some of the tests pass.  'from ctypes import *' is used quite frequently, and 
it would be better to change it, but I left it unchanged for now.  I also 
removed an obsolete warning about the doctest directives in the example because 
Sphinx hides them.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-10-11 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 FTR there were a few actual errors that I fixed (mostly about bytes vs 
 string).

Great!  Note that for the others, I was just trying to make the files parseable 
rather than passing.  Currently, doctest aborts out on the files I fixed 
without even attempting to run the examples.

 That can be done for 3.4+ only though.

Well, yes and no.  If there is a helper script to check documentation, it could 
be run on any branch regardless of whether the script is in source control.  
For example, I was planning to write such a script (from the regrtest patch I 
put together before) to help me when checking people's patches to code snippets 
in the documentation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-09-19 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-09-19 Thread Chris Jerdonek

Chris Jerdonek added the comment:

My opinion on the +LINUX and +WINDOWS doctest directives in 
Doc/library/ctypes.rst is simply to leave them alone for now.  We can make 
those errors go away in code when running doctest by adding no-op calls to 
doctest.register_optionflag() as below:

+doctest.register_optionflag('WINDOWS')
+doctest.register_optionflag('LINUX')

prior to constructing the doctest TestSuites.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-09-13 Thread Chris Jerdonek

New submission from Chris Jerdonek:

Currently, when trying to parse the *.rst files in the Doc/ folder (i.e. not 
actually running them but simply generating unittest.TestCase instances from 
them by passing them to doctest.DocFileSuite()), five files yield errors.

This issue is to make it so that all of the *.rst files in our Doc/ folder are 
at least parseable by doctest without error.

I will submit a patch.

Below are the errors that currently occur:

(1) test fdoc:library/ctypes.rst crashed -- Traceback (most recent call last):
  ...
ValueError: line 55 of the doctest for ctypes.rst has an invalid option: 
'+WINDOWS'

(2) test fdoc:library/doctest.rst crashed -- Traceback (most recent call last):
  ...
ValueError: line 1592 of the docstring for doctest.rst has inconsistent leading 
whitespace: '  ))'

(3) test fdoc:library/multiprocessing.rst crashed -- Traceback (most recent 
call last):
  ...
ValueError: line 1016 of the docstring for multiprocessing.rst lacks blank 
after : ''

(4) test fdoc:whatsnew/2.4.rst crashed -- Traceback (most recent call last):
  ...
ValueError: line 1422 of the docstring for 2.4.rst lacks blank after : '   
'

(5) test fdoc:whatsnew/2.7.rst crashed -- Traceback (most recent call last):
  ...
ValueError: line 1531 of the docstring for 2.7.rst lacks blank after   .: ' 
 ...'

--
assignee: docs@python
components: Documentation
messages: 170441
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: make *.rst files in Doc/ parseable by doctest
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-09-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

The attached patch addresses all but Doc/library/ctypes.rst.

See the following python-dev e-mail for a question about how best to handle 
that case:

http://mail.python.org/pipermail/python-dev/2012-September/121721.html

--
keywords: +patch
Added file: http://bugs.python.org/file27185/issue-15935-1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-09-13 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


Removed file: http://bugs.python.org/file27185/issue-15935-1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15939] make *.rst files in Doc/ parseable by doctest

2012-09-13 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


Added file: http://bugs.python.org/file27186/issue-15939-1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com