X-Received: by 10.224.93.19 with SMTP id t19mr5140030qam.3.1379767449774; Sat, 21 Sep 2013 05:44:09 -0700 (PDT) X-Received: by 10.49.1.112 with SMTP id 16mr281765qel.7.1379767449757; Sat, 21 Sep 2013 05:44:09 -0700 (PDT) Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!d5no1312085qap.0!news-out.google.com!gv3ni775qab.0!nntp.google.com!d5no1375111qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Sat, 21 Sep 2013 05:44:09 -0700 (PDT) In-Reply-To: <523d90b2$0$29988$c3e8da3$5496439d@news.astraweb.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=86.30.140.68; posting-account=Y18FNAoAAAAH6J_Od-2qLV1CDigBCPRj NNTP-Posting-Host: 86.30.140.68 References: <6fbfa8a5-92ab-4821-92ea-7eb4efbe199d@googlegroups.com> <523d90b2$0$29988$c3e8da3$5496439d@news.astraweb.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9de3b59f-6cd1-4357-a59e-b2ee028d59ab@googlegroups.com> Subject: Re: Sphinx Doctest: test the code without comparing the output. From: Luca Cerone Injection-Date: Sat, 21 Sep 2013 12:44:09 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2244 Xref: csiph.com comp.lang.python:54552 Dear Steven, thanks for the help. I am aware that I might have used the SKIP directive (as I hinted in my mail). Even if the fine manual suggests to do so I don't agree with it, though. The reason is simple: SKIP as the name suggests causes the code not to be run at all, it doesn't ignore the output. If you use a SKIP directive on code that contains a typo, or maybe you changed the name of a keyword to make it more meaningful and forgot to update your docstring, then the error won't be caught. For example: .. doctest:: example >>> printt "Hello, World!" # doctest: +SKIP "Hello, World!" would pass the test. Since I am writing a tutorial for people that have even less experience than me with Python, I want be sure that the code in my examples runs just fine. > > (There's no need to convert things to str before printing them.) > You are right, I modified an example that uses x in one of my functions that requires a string in input, and didn't change that. Thanks again for the help anyway, Cheers, Luca