Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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; 'test,': 0.07; 'raises': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'def': 0.12; 'skip:= 70': 0.12; '1.3.0': 0.16; '2.7.3': 0.16; 'dots': 0.16; 'nose': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'skips': 0.16; 'why,': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'import': 0.22; 'tests': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'received:comcast.net': 0.24; "i've": 0.25; 'skip:" 20': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'raise': 0.29; "doesn't": 0.30; "i'm": 0.30; 'included': 0.31; 'assert': 0.31; 'file:': 0.31; 'trivial': 0.31; 'file': 0.32; 'supposed': 0.32; 'run': 0.32; 'linux': 0.33; '(most': 0.33; 'test': 0.35; 'but': 0.35; 'ubuntu': 0.36; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'confirm': 0.64; 'total': 0.65; 'smith': 0.68; 'confusing': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: What does --no-skip do in nose? Date: Tue, 31 Dec 2013 20:50:40 -0500 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: c-50-133-228-126.hsd1.ma.comcast.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: 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: 78 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1388541053 news.xs4all.nl 2829 [2001:888:2000:d::a6]:42129 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62943 On 12/31/13 12:49 PM, Roy Smith wrote: > Environment: > Python 2.7.3 > nose 1.3.0 > Ubuntu 12.04 Linux > > I'm befuddled about how test skipping, and in particular, --no-skip, > is supposed to work in nose. I've got a trivial test file: > >> from nose import SkipTest >> def test_skip(): >> raise SkipTest >> assert 0 > > If I run this, it skips the test, as expected: > > >> $ nosetests try.py >> S >> ---------------------------------------------------------------------- >> Ran 1 test in 0.001s >> >> OK (SKIP=1) > > > What's confusing is, if I use --no-skip, it STILL skips the test: > >> $ nosetests --no-skip try.py >> >> ---------------------------------------------------------------------- >> Ran 1 test in 0.001s >> >> OK > > The only difference is it doesn't print the "S". Am I just > mis-understanding what --no-skip is supposed to do? > I don't understand why, but my tests confirm what you found: if a test raises SkipTest, then it is marked as an S, and included in the count of tests run. If you run with --no-skip, then the result of the test isn't displayed in the dots at all, but the test is still included in the total count: $ nosetests F.S ====================================================================== FAIL: test_fail (test_foo.Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/ned/lab/test_foo.py", line 8, in test_fail assert 0 AssertionError ---------------------------------------------------------------------- Ran 3 tests in 0.004s FAILED (SKIP=1, failures=1) $ nosetests --no-skip F. ====================================================================== FAIL: test_fail (test_foo.Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/ned/lab/test_foo.py", line 8, in test_fail assert 0 AssertionError ---------------------------------------------------------------------- Ran 3 tests in 0.003s FAILED (failures=1) -- Ned Batchelder, http://nedbatchelder.com