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


Groups > comp.lang.python > #83613

Re: annoying doctest problem

From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: annoying doctest problem
Date 2015-01-12 10:47 -0500
References <0e9e5a03-2291-490e-9220-fa6744c9e2e5@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.17626.1421077657.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 1/11/15 11:20 PM, gordianknot1981@gmail.com wrote:
>
> It failed with an unknown reason that evaluate two expected equal value but got an unexpected result! I'm struggling with this problem for a long time. Did I did something wrong? And how do I to fix it?
>
> any help is appreciated. :)
>

My recommendation is to use doctest to test the code samples that 
naturally occur in your docstrings, but not to use it as a 
general-purpose testing tool.  It has too many limitations and quirks, 
and if you're going to write separate test methods anyway, why not just 
write actual code?

More detail here: 
http://nedbatchelder.com/blog/200811/things_i_dont_like_about_doctest.html


-- 
Ned Batchelder, http://nedbatchelder.com

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


Thread

annoying doctest problem gordianknot1981@gmail.com - 2015-01-11 20:20 -0800
  Re: annoying doctest problem gordianknot1981@gmail.com - 2015-01-11 20:30 -0800
  Re: annoying doctest problem Steven D'Aprano <steve@pearwood.info> - 2015-01-12 05:24 +0000
    Re: annoying doctest problem Skip Montanaro <skip.montanaro@gmail.com> - 2015-01-12 06:15 -0600
      Re: annoying doctest problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-13 00:00 +1100
        Re: annoying doctest problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-12 14:59 +0000
          Re: annoying doctest problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-13 02:58 +1100
            Re: annoying doctest problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-12 16:46 +0000
        Re: annoying doctest problem Skip Montanaro <skip.montanaro@gmail.com> - 2015-01-12 12:15 -0600
    Re: annoying doctest problem Skip Montanaro <skip.montanaro@gmail.com> - 2015-01-12 06:32 -0600
  Re: annoying doctest problem Ned Batchelder <ned@nedbatchelder.com> - 2015-01-12 10:47 -0500
    Re: annoying doctest problem gordianknot1981@gmail.com - 2015-01-12 10:34 -0800

csiph-web