assertRaises give an assertion error with the following code. Is there something I'm doing wrong?
class File_too_small(Exception):
"Check file size"
def foo(a,b):
if a<b:
raise File_too_small
class some_Test(unittest.TestCase):
def test_foo(self):
self.assertRaises(File_too_small,foo(1,2))
The test seems to pass with the following modification though
def foo:
raise File_too_small
def test_foo(self):
self.assertRaises(File_too_small,foo)
Try like this:
or: