Ubuntu Pastebin

Paste from smoser at Fri, 17 Jul 2015 16:03:22 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
import unittest
class TestMe(unittest.TestCase):
    def _doraise(*args, **kwargs):
            raise Exception("args: %s kwargs: %s" % (args, kwargs))

    def test_raises(self):
        self.assertRaises(Exception, self._doraise, ["hi"])

    def test_assert_return(self):
        f = self.assertRaises(Exception, self._doraise, ["hi"])
        self.assertTrue(f)
Download as text