Browse Source

Fixes py3 test problems

Ask Solem 9 years ago
parent
commit
c60d990719
2 changed files with 9 additions and 3 deletions
  1. 4 1
      celery/tests/app/test_beat.py
  2. 5 2
      celery/tests/bin/test_base.py

+ 4 - 1
celery/tests/app/test_beat.py

@@ -94,7 +94,10 @@ class test_ScheduleEntry(AppCase):
         e2 = self.create_entry(schedule=timedelta(seconds=2))
         # order doesn't matter, see comment in __lt__
         res1 = e1 < e2  # noqa
-        res2 = e1 < object()  # noqa
+        try:
+            res2 = e1 < object()  # noqa
+        except TypeError:
+            pass
 
     def test_update(self):
         entry = self.create_entry()

+ 5 - 2
celery/tests/bin/test_base.py

@@ -245,8 +245,11 @@ class test_Command(AppCase):
         with self.assertRaises(AttributeError):
             cmd.find_app(__name__)
 
-    @patch('celery.bin.base.input')
-    def test_ask(self, input):
+    def test_ask(self):
+        try:
+            input = self.patch('celery.bin.base.input')
+        except AttributeError:
+            input = self.patch('builtins.input')
         cmd = MockCommand(app=self.app)
         input.return_value = 'yes'
         self.assertEqual(cmd.ask('q', ('yes', 'no'), 'no'), 'yes')