On 2013-09-22, Luca Cerone <luca.cer...@gmail.com> wrote:
> I understand your point, but now I am not writing unit tests to
> check the correctness of the code. I am only writing a tutorial
> and assuming that the code is correct. What I have to be sure
> is that the code in the tutorial can be executed correctly, and
> some commands print verbose output which can change.
>
> It is not enough to write >>> ignore = function(a,b,c) won't
> work because the function still prints messages on screen and
> this causes the failure of the test...

It won't be very good documenation any more but nothing stops you
from examining the result in the next doctest and making yourself
happy about it.

  >>> x = input("indeterminate:")
  >>> result = "'{}'".format(x))
  >>> result.startswith("'") and result.endswith("'")
  True

-- 
Neil Cerutti
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to