Ask Solem il y a 11 ans
Parent
commit
2c821c172d

+ 1 - 1
celery/app/base.py

@@ -262,7 +262,7 @@ class Celery(object):
         self.conf.update(self.loader.cmdline_config_parser(argv, namespace))
 
     def setup_security(self, allowed_serializers=None, key=None, cert=None,
-            store=None, digest='sha1', serializer='json'):
+                       store=None, digest='sha1', serializer='json'):
         from celery.security import setup_security
         return setup_security(allowed_serializers, key, cert,
                               store, digest, serializer, app=self)

+ 1 - 1
celery/tests/security/test_security.py

@@ -77,7 +77,7 @@ class test_security(SecurityCase):
                 calls[0] += 1
 
         prev, self.app.conf.CELERY_TASK_SERIALIZER = (
-                self.app.conf.CELERY_TASK_SERIALIZER, 'auth')
+            self.app.conf.CELERY_TASK_SERIALIZER, 'auth')
         try:
             with mock_open(side_effect=effect):
                 with patch('celery.security.registry') as registry:

+ 2 - 4
celery/tests/tasks/test_result.py

@@ -11,11 +11,9 @@ from celery.result import (
     EagerResult,
     TaskSetResult,
     ResultSet,
-    GroupResult,
+    #GroupResult,
     from_serializable,
 )
-from celery.task import task
-from celery.task.base import Task
 from celery.utils import uuid
 from celery.utils.serialization import pickle
 
@@ -437,7 +435,7 @@ class test_GroupResult(AppCase):
     def test_is_pickleable(self):
         ts = self.app.GroupResult(uuid(), [self.app.AsyncResult(uuid())])
         self.assertEqual(pickle.loads(pickle.dumps(ts)), ts)
-        ts2 = GroupResult(uuid(), [self.app.AsyncResult(uuid())])
+        ts2 = self.app.GroupResult(uuid(), [self.app.AsyncResult(uuid())])
         self.assertEqual(pickle.loads(pickle.dumps(ts2)), ts2)
 
     def test_len(self):

+ 5 - 8
celery/tests/tasks/test_tasks.py

@@ -1264,7 +1264,6 @@ class test_crontab_is_due(AppCase):
         self.assertFalse(due)
         self.assertEqual(remaining, 4 * 24 * 60 * 60 - 3 * 60 * 60)
 
-
     @patch_crontab_nowfun(monthly_moy, datetime(2014, 2, 26, 22, 0))
     def test_monthly_moy_execution_is_due(self):
         due, remaining = monthly_moy.run_every.is_due(
@@ -1274,14 +1273,14 @@ class test_crontab_is_due(AppCase):
 
     @patch_crontab_nowfun(monthly_moy, datetime(2013, 6, 28, 14, 30))
     def test_monthly_moy_execution_is_not_due(self):
-        
         due, remaining = monthly_moy.run_every.is_due(
             datetime(2013, 6, 28, 22, 14))
         self.assertFalse(due)
-        attempt = (time.mktime(datetime(2014, 2, 26, 22, 0).timetuple())
-                   - time.mktime(datetime(2013, 6, 28, 14, 30).timetuple())
-                   - 60 * 60
-                   ) 
+        attempt = (
+            time.mktime(datetime(2014, 2, 26, 22, 0).timetuple()) -
+            time.mktime(datetime(2013, 6, 28, 14, 30).timetuple()) -
+            60 * 60
+        )
         self.assertEqual(remaining, attempt)
 
     @patch_crontab_nowfun(monthly_moy, datetime(2014, 2, 26, 22, 0))
@@ -1293,14 +1292,12 @@ class test_crontab_is_due(AppCase):
 
     @patch_crontab_nowfun(monthly_moy, datetime(2014, 2, 26, 21, 0))
     def test_monthly_moy_execution_is_not_due2(self):
-        
         due, remaining = monthly_moy.run_every.is_due(
             datetime(2013, 6, 28, 22, 14))
         self.assertFalse(due)
         attempt = 60 * 60
         self.assertEqual(remaining, attempt)
 
-
     @patch_crontab_nowfun(yearly, datetime(2010, 3, 11, 7, 30))
     def test_yearly_execution_is_due(self):
         due, remaining = yearly.run_every.is_due(