Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'tutorial': 0.03; 'syntax': 0.04; 'output': 0.05; 'correct.': 0.07; 'subject:code': 0.07; 'exception,': 0.09; 'output,': 0.09; 'seemed': 0.09; 'subject:test': 0.09; 'unittest': 0.09; 'cc:addr:python-list': 0.11; 'chris,': 0.16; 'incorrect': 0.16; 'ignore': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'code': 0.31; 'maybe': 0.34; 'subject:the': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'date.': 0.36; 'sure': 0.39; 'changed': 0.39; 'enough': 0.39; 'how': 0.40; "you're": 0.61; "you'll": 0.62; 'to:addr:gmail.com': 0.65; 'details': 0.65; 'incredibly': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=A6GEl91QbxiPSz72pzi27EE+uiqQg63vqbIHvPvwLJU=; b=MQUwqpy3hlCfW5VvN6a1OjksggKBEVDOBJT3iSiAyAmNoW7Wcd6mVSq1DO3xWjDpZB AcEFAa8ScOfOp28sZEDEGLFXnDY6HXHRqIUdQR284KYfXRUcCwUNh0jBMFSfhmu7/7Ui gSbTAR1zfBQWvywB/gG4N2jl5/yM8/AUmdwNq9TaU8Us+AP7IWQP2osCTiIb7MRpblze onclQr4/Qi3lh9SGOsTmnmfUiZXKHXvyq1FR3FPUtmj0XKW00sqNl0Sdh85HA5EfaqfG QRZh2hNQ2cmnCbCPdt5w0K7so9D1KjpT++V/9sKzHxotIFr8Tbj/Slh0F8dXECUSVo6m cVBg== X-Received: by 10.224.172.132 with SMTP id l4mr17353650qaz.22.1379857149267; Sun, 22 Sep 2013 06:39:09 -0700 (PDT) Sender: Ned Batchelder Date: Sun, 22 Sep 2013 09:39:07 -0400 From: Ned Batchelder User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Luca Cerone Subject: Re: Sphinx Doctest: test the code without comparing the output. References: <6fbfa8a5-92ab-4821-92ea-7eb4efbe199d@googlegroups.com> <523d90b2$0$29988$c3e8da3$5496439d@news.astraweb.com> <9de3b59f-6cd1-4357-a59e-b2ee028d59ab@googlegroups.com> <523dbfd2$0$29988$c3e8da3$5496439d@news.astraweb.com> <0a3a0078-2d55-4cc8-bf8d-f7bede6af9f1@googlegroups.com> <5dd79e42-f1ef-4a90-b540-70f164771562@googlegroups.com> In-Reply-To: <5dd79e42-f1ef-4a90-b540-70f164771562@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1379857158 news.xs4all.nl 16002 [2001:888:2000:d::a6]:35642 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54585 On 9/22/13 12:09 AM, Luca Cerone wrote: > Hi Chris, > actually my priority is to check that the code is correct. I changed the syntax > during the development, and I want to be sure that my tutorial is up to date. > If you do manage to ignore the output, how will you know that the syntax is correct? The output for an incorrect syntax line will be an exception, which you'll ignore. Maybe I don't know enough about the details of doctest. It's always seemed incredibly limited to me. Essentially, it's as if you used unittest but the only assertion you're allowed to make is self.assertEqual(str(X), "....") --Ned.