trying to find nose.tools.assert_raises_regexp

Q

qhfgva

$ 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.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...
 
N

Ned Batchelder

$ 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.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.
 
Q

qhfgva

I knew it had to be something like that. Thanks. Time to upgrade.

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.

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.



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.



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.

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.



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.



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.

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.



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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top