Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'scripts': 0.03; 'tutorial': 0.03; 'output': 0.05; 'subject:code': 0.07; '22,': 0.09; 'correct,': 0.09; 'subject:test': 0.09; 'expert,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'normally.': 0.16; 'script,': 0.16; 'syntactic': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'result.': 0.19; 'not,': 0.20; 'command': 0.22; '(in': 0.22; 'creating': 0.23; 'certain': 0.27; 'header:In- Reply-To:1': 0.27; 'testing': 0.29; 'correct': 0.29; 'am,': 0.29; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; 'sep': 0.31; 'languages': 0.32; 'running': 0.33; 'programmers': 0.33; 'trouble': 0.34; 'subject:the': 0.34; "i'd": 0.34; 'tool': 0.35; 'something': 0.35; 'case,': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'doing': 0.36; 'useful': 0.36; 'should': 0.36; 'being': 0.38; 'to:addr:python- list': 0.38; 'rather': 0.38; 'anything': 0.39; 'expect': 0.39; 'extremely': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'simple': 0.61; "you're": 0.61; 'first': 0.61; 'believe': 0.68; 'saving': 0.69; 'risk': 0.72; 'sole': 0.78; 'novice': 0.91; 'smoke': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=eVhemMqwxEkNxiHtJjPJ+XGrs51L8mU1xOnpy/bSMFI=; b=MZ1tG/rDiGLvq0mbjsoHl2D/5OA/LNjxnm0PLFh/HmXO2m+FjFg8ZDl/yCxcJxMhuj 3DrOqSWLsHIQi635iCRbHhutmh48Dd+1BEx/0F59QoOKtvSGmiQeZo9B9jp9WNynlSpk it0UQWXWI4z8mEz2/te6HI+co03r1pviBIYX1RzOJ1uG+3Z0lvhksWZWgAtXQIi6GAzD 8Qkl/bZixbzT1NG6kAsYVogBM3l6XxzyxqtfMKYbukPsDSjXXgwPkfLGircYNZzV/cDX IOqV9R2suFN3ryAvD9ovbucAntNx/9nMsAc42hCRnD+aIkwHCkHh/qAcDEnELe2tBsiC PZTw== MIME-Version: 1.0 X-Received: by 10.52.75.228 with SMTP id f4mr11463295vdw.6.1379813604342; Sat, 21 Sep 2013 18:33:24 -0700 (PDT) In-Reply-To: <0a3a0078-2d55-4cc8-bf8d-f7bede6af9f1@googlegroups.com> 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> Date: Sun, 22 Sep 2013 11:33:24 +1000 Subject: Re: Sphinx Doctest: test the code without comparing the output. From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1379813607 news.xs4all.nl 15888 [2001:888:2000:d::a6]:39526 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54570 On Sun, Sep 22, 2013 at 2:25 AM, Luca Cerone wrote: > The difference is that in that case you want to check whether the result is correct or not, because you expect a certain result. > > In my case, I don't know what the output is, nor care for the purpose of the tutorial. What I care is being sure that the command in the tutorial is correct, and up to date with the code. I'd call that a smoke-test, rather than something a test harness/engine should be doing normally. All you do is see if the program crashes. This can be extremely useful (I smoke-test my scripts as part of my one-key "deploy to testbox" script, saving me the trouble of actually running anything - simple syntactic errors or misspelled function/variable names (in languages where that's a concept) get caught really early); but if you're using this for a tutorial, you risk creating a breed of novice programmers who believe their first priority is to stop the program crashing. Smoke testing is a tool that should be used by the expert, NOT a sole check given to a novice. ChrisA