Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)
Fail unless an exception of class excClass is raised
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
raised, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.

If called with callableObj omitted or None, will return a
context object used like this::

src/r/e/reprep-2.2/src/reprep/tests/test_idioms.py   reprep(Download)
    def testTable4(self):
        data = numpy.zeros((2, 2, 3))
        self.assertRaises(ValueError, Table, 'mytable', data)
    def testTable5(self):
        dtype = numpy.dtype([('field1', 'int32'), ('field2', 'int32')])
        data = numpy.zeros(shape=(5, 4), dtype=dtype)
        self.assertRaises(ValueError, Table, 'mytable', data)
    def test_invalid_id(self):
        self.assertRaises((ValueError, ContractNotRespected), Report, 1)
    def test_invalid_id_2(self):
        valid = [
        for s in invalid:
            print('TRying with %r' % s)
            self.assertRaises((ValueError, ContractNotRespected), Report, s)
        for s in valid:
    def test_invalid_children(self):
        self.assertRaises((ValueError, ContractNotRespected),