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)

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)

Make tests pass in Python 2.5 by importing with_statement from __future__
Make tests pass in Python 2.5 by importing with_statement from __future__

+ 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)
  
Make tests pass in Python 2.5 by importing with_statement from __future__
## Code Before:
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)

## Instruction:
Make tests pass in Python 2.5 by importing with_statement from __future__
## Code After:
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)
