Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

assert raises with properties python

from unittest import TestCase

class MyTest(TestCase):
    def test_property(self):
        # Test that Type Error is correctly raised
        obj = MyClass("foobar")
        self.assertRaises(TypeError, lambda: x.my_property, obj)
 
PREVIOUS NEXT
Tagged: #assert #raises #properties #python
ADD COMMENT
Topic
Name
1+2 =