def test_lambdaRaisesPicklingError(self):
        """
        Pickling a C{lambda} function ought to raise a L{pickle.PicklingError}.
        """
        self.assertRaises(pickle.PicklingError, pickle.dumps, lambdaExample)
        try:
            import cPickle
        except:
            pass
        else:
            self.assertRaises(cPickle.PicklingError, cPickle.dumps,
                              lambdaExample)

        Pickling a C{lambda} function ought to raise a L{pickle.PicklingError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/persisted/test/test_styles.py