예제 #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()
예제 #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()
예제 #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)
예제 #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)