Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #13067

Re: Doctest failing

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.wiretrip.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <t@jollybox.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'example:': 0.03; 'python': 0.08; '__name__': 0.09; 'guys.': 0.09; 'output': 0.10; 'def': 0.15; '"__main__":': 0.16; 'code?': 0.16; 'doctest': 0.16; 'expected,': 0.16; 'failing': 0.16; 'failure.': 0.16; 'module?': 0.16; 'wrote:': 0.16; 'stuff': 0.22; 'header:In-Reply-To:1': 0.22; 'tests.': 0.23; 'testing': 0.24; 'tests': 0.25; "i'm": 0.27; 'correct': 0.28; 'import': 0.28; 'does': 0.32; 'to:addr:python- list': 0.33; 'instead': 0.33; 'header:User-Agent:1': 0.34; 'test': 0.34; 'file': 0.36; 'two': 0.37; 'some': 0.38; 'subject:: ': 0.39; 'received:192': 0.39; 'getting': 0.39; 'help': 0.39; 'to:addr:python.org': 0.39; 'sense': 0.39; 'skip:d 20': 0.39; 'one,': 0.40; 'your': 0.61; 'here.': 0.66; 'skip:* 70': 0.68; 'received:62': 0.70; 'failures.': 0.84; 'from:addr:t': 0.84
Date Sat, 10 Sep 2011 13:50:14 +0200
From Thomas Jollans <t@jollybox.de>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:6.0.1) Gecko/20110831 Thunderbird/6.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: Doctest failing
References <678b89fd-82f4-4080-8b36-e4d0ba30cdbf@o9g2000vbo.googlegroups.com>
In-Reply-To <678b89fd-82f4-4080-8b36-e4d0ba30cdbf@o9g2000vbo.googlegroups.com>
X-Enigmail-Version 1.3.1
OpenPGP id=5C8691ED
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.934.1315655395.27778.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1315655395 news.xs4all.nl 2500 [2001:888:2000:d::a6]:42915
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:13067

Show key headers only | View raw


On 10/09/11 13:20, Tigerstyle wrote:
> Hi guys.
> 
> I'm strugglin with some homework stuff and am hoping you can help me
> out here.
>
> All tests are failing even though I am getting the correct output on
> the first two tests. And the last test still gives me "Of" instead of
> "of"

Cannot reproduce. I only get the one, expected, failure.

% python -m doctest books.py
**********************************************************************
File "books.py", line 12, in books.book_title
Failed example:
    book_title('the WORKS OF AleXANDer dumas')
Expected:
    'The Works of Alexander Dumas'
Got:
    'The Works Of Alexander Dumas'
**********************************************************************
1 items had failures:
   1 of   3 in books.book_title
***Test Failed*** 1 failures.

>
> def _test():
>     import doctest, refactory
>     return doctest.testmod(refactory)
> if __name__ == "__main__":
>     _test()
>

What is this "refactory"? Are you testing the right code? What is the
output of your test - does it make sense for the module?

Thomas

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-10 04:20 -0700
  Re: Doctest failing Mel <mwilson@the-wire.com> - 2011-09-10 07:43 -0400
    Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:36 -0700
  Re: Doctest failing Peter Otten <__peter__@web.de> - 2011-09-10 13:47 +0200
    Re: Doctest failing ting@thsu.org - 2011-09-10 19:12 -0700
      Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:42 -0700
  Re: Doctest failing Thomas Jollans <t@jollybox.de> - 2011-09-10 13:50 +0200
    Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:39 -0700
  Re: Doctest failing Alister Ware <alister.ware@ntlworld.com> - 2011-09-10 12:24 +0000
    Re: Doctest failing Chris Angelico <rosuav@gmail.com> - 2011-09-11 01:56 +1000
      Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:40 -0700
    Re: Doctest failing Ethan Furman <ethan@stoneleaf.us> - 2011-09-11 11:43 -0700
    Re: Doctest failing Chris Angelico <rosuav@gmail.com> - 2011-09-12 11:03 +1000
      Re: Doctest failing Ben Finney <ben+python@benfinney.id.au> - 2011-09-12 11:37 +1000
        Re: Doctest failing Chris Angelico <rosuav@gmail.com> - 2011-09-12 13:06 +1000
          Re: Doctest failing Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-12 14:29 +1000
  Re: Doctest failing Terry Reedy <tjreedy@udel.edu> - 2011-09-10 13:59 -0400
    Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 04:46 -0700
      Re: Doctest failing Terry Reedy <tjreedy@udel.edu> - 2011-09-11 13:03 -0400
  Re: Doctest failing Terry Reedy <tjreedy@udel.edu> - 2011-09-10 15:36 -0400
  Re: Doctest failing Peter Otten <__peter__@web.de> - 2011-09-10 22:49 +0200
  Re: Doctest failing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-09-10 16:25 -0700
  Re: Doctest failing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-09-10 23:18 -0700
    Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:43 -0700
      Re: Doctest failing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-09-11 12:37 -0700

csiph-web