Example #1
0
 def _do_test(pcount):
     pcount.side_effect = NotImplementedError("cpu_count")
     from celery.apps.worker import cpu_count
     self.assertEqual(cpu_count(), 2)
     pcount.assert_called_with()
Example #2
0
 def _do_test(pcount):
     pcount.side_effect = NotImplementedError("cpu_count")
     from celery.apps.worker import cpu_count
     self.assertEqual(cpu_count(), 2)
     pcount.assert_called_with()
Example #3
0
 def test_cpu_count_no_mp(self):
     with mask_modules("multiprocessing"):
         with reset_modules("celery.apps.worker"):
             from celery.apps.worker import cpu_count
             self.assertEqual(cpu_count(), 2)
Example #4
0
 def test_cpu_count_no_mp(self):
     with mask_modules("multiprocessing"):
         with reset_modules("celery.apps.worker"):
             from celery.apps.worker import cpu_count
             self.assertEqual(cpu_count(), 2)