old_contents: import sys
  import unittest
  
  
  class TestAAPickle(unittest.TestCase):
  
      def test_no_cpickle(self):
          from celery.tests.utils import mask_modules
          del(sys.modules["celery.serialization"])
          with mask_modules("cPickle"):
              from celery.serialization import pickle
              import pickle as orig_pickle
              self.assertTrue(pickle.dumps is orig_pickle.dumps)
  
new_contents: from __future__ import with_statement
  import sys
  import unittest
  
  
  class TestAAPickle(unittest.TestCase):
  
      def test_no_cpickle(self):
          from celery.tests.utils import mask_modules
          del(sys.modules["celery.serialization"])
          with mask_modules("cPickle"):
              from celery.serialization import pickle
              import pickle as orig_pickle
              self.assertTrue(pickle.dumps is orig_pickle.dumps)
  
subject: Make tests pass in Python 2.5 by importing with_statement from __future__