I'm an admitted newb trying to enter the Python community and use Python
significantly (versus occassionally). dockets seems to be much more powerful
than I can figure out how to tap.
I have a function inside a file that's an embedded test that (currently) works
fine. However, the package has
On 27/11/12 20:50, Albert-Jan Roskam wrote:
Function name "_setMultRespDefsEx" is not self-explanatory, or even
*hint* at what the function is supposed to do. It appears to take a
dictionary of stuff, and formats it as a string. It would be nice[1]
if your docstring explained what sort of stuff.
On 11/27/2012 04:50 AM, Albert-Jan Roskam wrote:
>
>> On 27/11/12 08:06, Albert-Jan Roskam wrote:
>>> (Steven D'Aprano wrote, even though the indentation is wrong)
>>>
>>>
>>>
>>> Doctesting anything to do with dictionaries is tricky, because you
>>> cannot rely on the order of a dict. There are
> On 27/11/12 08:06, Albert-Jan Roskam wrote:
>> Hi,
>>
>> I am using doctest and I am struggling with newlines characters
>> (see below). One is the newline escape (backslash) for a long
>> dictionary definition. The other is an embedded \n in the output.
>> I used the +NORMALIZE_WHITESPACE dir
On 27/11/12 09:02, Steven D'Aprano wrote:
Here's my attempt:
def _setMultRespDefsEx(multRespDefs):
"""Format a dictionary of stuff as a string. Expects that dict contains:
[...]
KNOWN BUGS:
1) Sometimes this function returns a dict instead of a string.
2) The formatted string output is amb
On 27/11/12 08:06, Albert-Jan Roskam wrote:
Hi,
I am using doctest and I am struggling with newlines characters
(see below). One is the newline escape (backslash) for a long
dictionary definition. The other is an embedded \n in the output.
I used the +NORMALIZE_WHITESPACE directive. I also tried
Hi,
I am using doctest and I am struggling with newlines characters (see below).
One is the newline escape (backslash)
for a long dictionary definition. The other is an embedded \n in the output. I
used the +NORMALIZE_WHITESPACE
directive. I also tried using a triple-quoted raw docstring. Any id
On 11/17/2011 10:56 PM, Nidian Job-Smith wrote:
Date: Thu, 17 Nov 2011 22:49:33 -0500
From: d...@davea.name
To: nidia...@hotmail.com
CC: tutor@python.org
Subject: Re: [Tutor] Doctest error!
On 11/18/2011 10:29 AM, John wrote:
Hi all,
When i run a
> Date: Thu, 17 Nov 2011 22:49:33 -0500
> From: d...@davea.name
> To: nidia...@hotmail.com
> CC: tutor@python.org
> Subject: Re: [Tutor] Doctest error!
>
> On 11/18/2011 10:29 AM, John wrote:
> >
> > Hi all,
> > Whe
On 11/18/2011 10:29 AM, John wrote:
Hi all,
When i run a doctest on this piece of code (shown at bottom) i get
this error message [from the doctest]:
Trying:
rot13('5 The Parade')
Expecting:
'5 Gur Cnenqr'
**
File "
Hi all,
When i run a doctest on this piece of code (shown at bottom) i get this error
message [from the doctest]:
Trying:
rot13('5 The Parade')
Expecting:
'5 Gur Cnenqr'
**
File "F:\Uni\Rot13_1.py", line 12, in Rot13_
[Tim Peters]
>> That "should work", provided there aren't differences in whitespace
>> that are invisible to us in this medium. For example, if, in your
>> source file, there's actually a (one or more) trailing space on your
>> line of expected output, then it would _not_ match the actual output.
Tim Peters wrote:
> That "should work", provided there aren't differences in whitespace
> that are invisible to us in this medium. For example, if, in your
> source file, there's actually a (one or more) trailing space on your
> line of expected output, then it would _not_ match the actual output
[Don Taylor]
> I am trying to use Doctest and am having trouble using the ellipsis
> feature when trying to match an object reference.
>
> Here is the code:
>
> def add_change_listener(self, listener):
> '''
>
> Returns list of listeners just for testing.
> >>> def m
Kent Johnson wrote:
> Don Taylor wrote:
>
>>Hi:
>>
>>I am trying to use Doctest and am having trouble using the ellipsis
>>feature when trying to match an object reference.
>
>
> What version of Python are you using? The ELLIPSIS comment was added in
> Python 2.4.
>
I am using 2.4.2
Don.
_
Don Taylor wrote:
> Hi:
>
> I am trying to use Doctest and am having trouble using the ellipsis
> feature when trying to match an object reference.
What version of Python are you using? The ELLIPSIS comment was added in
Python 2.4.
Kent
>
> Here is the code:
>
> def add_change_listener
Hi:
I am trying to use Doctest and am having trouble using the ellipsis
feature when trying to match an object reference.
Here is the code:
def add_change_listener(self, listener):
'''
Returns list of listeners just for testing.
>>> def mock_listener():
Alan Gauld wrote:
Also, anything I can do... Presently, since I'm running windows xp,
I would
have to hunt for the command prompt and type in the command
Start->Run
Type cmd,
Hit OK
:-)
Or drag the icon from accessories into the start menu or to
the desktop.
Or drag the icon to the left side of th
Jacob S. wrote:
Even so, doctest doesn't seem to recognize the module level docstring.
It will run the test inside the functions, but it says there isn't a test on
the module level.
I put the docstring just like in the example at the link you provided...
Please post the code for the module you are
> Also, anything I can do... Presently, since I'm running windows xp,
I would
> have to hunt for the command prompt and type in the command
Start->Run
Type cmd,
Hit OK
:-)
Or drag the icon from accessories into the start menu or to
the desktop.
> '"C:\python24\python.exe" "C:\documents and
sett
> Also, anything I can do... Presently, since I'm running windows xp, I
> would have to hunt for the command prompt and type in the command
Click Start, click Run, type CMD, press Enter.
Voila! :)
Patric
>
> '"C:\python24\python.exe" "C:\documents and
> settings\jacob\desktop\working python
I forgot to mention...
When I explicitly define the variable __doc__ at the module level, it *does*
recognize the module level docstring.
> I think I'm losing my mind...
>
> Maybe it's because I go back to school the day after tomorrow?
> The thing that helped the most was the -v parameter...
>
>
I think I'm losing my mind...
Maybe it's because I go back to school the day after tomorrow?
The thing that helped the most was the -v parameter...
Even so, doctest doesn't seem to recognize the module level docstring.
It will run the test inside the functions, but it says there isn't a test on
t
What docs are you looking at?? The module docs at http://docs.python.org/lib/module-doctest.html
have a complete example of testing a module with a main function. Or you can use the code in my last
post.
Kent
Jacob S. wrote:
Hi.
Okay, so I look at the documentation at it says (in my words):
Hi.
Okay, so I look at the documentation at it says (in my words):
"First Class - DocTest -- Make a test object with such and such attributes
that you can test.
Second Class - i don't remember the name - Make Jacob look stupid with big
words
Third Class - DocTestSuite - Convert a doctest obje
25 matches
Mail list logo