Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news.astraweb.com!border2.a.newsrouter.astraweb.com!news.tele.dk!news.tele.dk!small.news.tele.dk!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; 'explicitly': 0.05; 'attribute': 0.07; 'mentions': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:trying': 0.09; 'unittest': 0.09; 'url:github': 0.09; 'python': 0.11; 'exist.': 0.16; 'nose': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.18; 'module': 0.19; '(the': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'received:comcast.net': 0.24; 'code:': 0.26; '2010,': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; "i'm": 0.30; 'code': 0.31; '"",': 0.31; '>>>>': 0.31; 'file': 0.32; '(most': 0.33; 'but': 0.35; 'version': 0.36; 'method': 0.36; 'project': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:n 30': 0.60; 'new': 0.61; 'skip:n 10': 0.64; 'more': 0.64; 'subject:find': 0.84; 'url:master': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: trying to find nose.tools.assert_raises_regexp Date: Fri, 23 May 2014 20:07:08 -0400 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.5.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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1400890049 news.xs4all.nl 2851 [2001:888:2000:d::a6]:44084 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71949 On 5/23/14 6:09 PM, qhfgva wrote: > $ python > Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) > [GCC 4.4.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import nose.tools >>>> nose.__version__ > '1.3.3' >>>> nose.tools.assert_raises_regexp > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object has no attribute 'assert_raises_regexp' > > > I see people using code like the following > > from nose.tools import assert_equals, assert_raises_regexp > > (the above line is from diy-lisp - a python project on githup) > > but I'm not able to find a version of nose that explicitly mentions this function. > > perplexed... > nose.tools auto-creates these names from the names in unittest, with this code: https://github.com/nose-devs/nose/blob/master/nose/tools/trivial.py#L46 You don't have assert_raises_regexp because your unittest module doesn't have assertRaisesRegexp. That method is new in 2.7, but you are using 2.6.5, so it doesn't exist. -- Ned Batchelder, http://nedbatchelder.com