( self )
| 41 | class IgnoredExceptionsTest( unittest.TestCase ) : |
| 42 | |
| 43 | def test( self ) : |
| 44 | |
| 45 | def f( toRaise, toIgnore ) : |
| 46 | |
| 47 | with IECore.IgnoredExceptions( toIgnore ) : |
| 48 | raise toRaise |
| 49 | |
| 50 | self.assertRaises( RuntimeError, f, RuntimeError, KeyError ) |
| 51 | self.assertRaises( RuntimeError, f, RuntimeError, ( KeyError, IndexError ) ) |
| 52 | |
| 53 | f( KeyError, KeyError ) |
| 54 | f( KeyError, ( KeyError, IndexError ) ) |
| 55 | f( IndexError, ( KeyError, IndexError ) ) |
| 56 | |
| 57 | c = IECore.CompoundObject() |
| 58 | with IECore.IgnoredExceptions( KeyError ) : |
| 59 | c["d"] |
| 60 | |
| 61 | with IECore.IgnoredExceptions( Exception ) : |
| 62 | c["d"] |
| 63 | |
| 64 | p = IECore.Parameterised( "" ) |
| 65 | with IECore.IgnoredExceptions( Exception ) : |
| 66 | p["d"] |
| 67 | |
| 68 | def testNoExceptions( self ) : |
| 69 |
nothing calls this directly
no test coverage detected