In article c38a5bb4-6087-453c-8873-f193927fd...@d8g2000yqf.googlegroups.com
Inyeol inyeol@gmail.com wrote:
[snippage below]
import unittest
class C():
def __getattr__(self, name):
raise AttributeError
class Test(unittest.TestCase):
def test_getattr(self):
c = C()
Unittest assertRaises cannot handle exception raised inside
__getattr__ method. Is it a bug? or am I missing something obvious?
Here is a sample of this problem:
-
import unittest
class C():
def simple_attr(self):
raise
Inyeol inyeol.lee at gmail.com writes:
or am I missing something obvious?
The attribute access is evaluated before the call to assertRaises, so unittest
never has a cache to cache it.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Oct 26, 2010 at 7:51 PM, Benjamin Peterson benja...@python.org wrote:
Inyeol inyeol.lee at gmail.com writes:
or am I missing something obvious?
The attribute access is evaluated before the call to assertRaises, so unittest
never has a
cache to cache it.
or rather, chance to catch