Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71944 > unrolled thread

trying to find nose.tools.assert_raises_regexp

Started byqhfgva <qhfgva@gmail.com>
First post2014-05-23 15:09 -0700
Last post2014-05-23 19:14 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  trying to find nose.tools.assert_raises_regexp qhfgva <qhfgva@gmail.com> - 2014-05-23 15:09 -0700
    Re: trying to find nose.tools.assert_raises_regexp Ned Batchelder <ned@nedbatchelder.com> - 2014-05-23 20:07 -0400
      Re: trying to find nose.tools.assert_raises_regexp qhfgva <qhfgva@gmail.com> - 2014-05-23 19:14 -0700

#71944 — trying to find nose.tools.assert_raises_regexp

Fromqhfgva <qhfgva@gmail.com>
Date2014-05-23 15:09 -0700
Subjecttrying to find nose.tools.assert_raises_regexp
Message-ID<f82fc86a-f2a9-4f97-8f37-0f117656d22a@googlegroups.com>
$ 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 "<stdin>", line 1, in <module>
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...

[toc] | [next] | [standalone]


#71949

FromNed Batchelder <ned@nedbatchelder.com>
Date2014-05-23 20:07 -0400
Message-ID<mailman.10259.1400890049.18130.python-list@python.org>
In reply to#71944
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 "<stdin>", line 1, in <module>
> 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

[toc] | [prev] | [next] | [standalone]


#71953

Fromqhfgva <qhfgva@gmail.com>
Date2014-05-23 19:14 -0700
Message-ID<6777d173-3919-4d07-8a66-103fb4d91537@googlegroups.com>
In reply to#71949
I knew it had to be something like that.  Thanks.  Time to upgrade.

On Friday, May 23, 2014 6:07:08 PM UTC-6, Ned Batchelder wrote:
> 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 "<stdin>", line 1, in <module>
> 
> > 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



On Friday, May 23, 2014 6:07:08 PM UTC-6, Ned Batchelder wrote:
> 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 "<stdin>", line 1, in <module>
> 
> > 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



On Friday, May 23, 2014 6:07:08 PM UTC-6, Ned Batchelder wrote:
> 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 "<stdin>", line 1, in <module>
> 
> > 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web