Re: Simple Doc Test failing without any reason [Help Needed]



I copied the text off here into a new file and it worked!.

I then took a diff between the version that didnt work and the version
that worked and the only difference was a couple of spaces after this
line:-

sanitize_number('0321-4683113')<There were some spaces in these angle brackets>

Apparently they caused the test case to fail on this.

Weird behavior :/

Thanks for your time Gerard and thanks to everyone else too.


On May 28, 5:11 pm, Gerard Flanagan <grflana...@xxxxxxxxx> wrote:
On May 28, 1:48 pm, afrobeard <afrobe...@xxxxxxxxx> wrote:



The following following code fails with the failiure:-

File "test.py", line 27, in __main__.sanitize_number
Failed example:
    sanitize_number('0321-4683113')
Expected:
    '03214683113'
Got:
    '03214683113'

Expected and Got looks the same. The value should verify.  What am I
doing wrong here ?

Thanks in advance. I really appreciate your time.

P.S. I tested this Python2.5 installed on both Ubuntu Hardy Heron and
Windows XP

Your code works for me (Python 2.5 WinXP).

Are you mixing tabs and spaces?

G.

.



Relevant Pages

  • PATCH: sets.py for Jython 2.1
    ... lack of generators and itertools, and dictionaries not supporting "x in d". ... To use this diff, copy sets.py from the standard Python 2.3 library location ... def ifilterfalse: ...
    (comp.lang.python)
  • Re: Object Diffs
    ... I am doing research into doing network based propagation of python ... In order to maintain network efficiency. ... If a and b are both numbers, the diff between them is just a-b, but this ... or I could actually create a pickle of the object and then use ...
    (comp.lang.python)
  • Help with arrays of strings
    ... I only have a passing acquaintance with Python and I need to modify some ... I'm working on changing it to convert from CVS to git. ... The strings have embedded @'s doubled as an escape sequence, ... After each diff is applied I need to convert the array of lines back into ...
    (comp.lang.python)
  • Re: How to start dialup network (DUN)?
    ... the timeout and sleep batch commands are not ... Microsoft 2003 server tool kit and it works just fine in a WinXP batch ... Sorry but i cant tell you why they didnt work because i dont have those commands. ...
    (microsoft.public.windowsxp.general)