Ejemplo n.º 1
0
 def testNoMultiproc(self):
     """Tests that NUMBER_OF_PROCESSORS is used."""
     with ou.change_environ('NUMBER_OF_PROCESSORS', '13'):
         self.assertEqual(13, pu.cpu_count(object()))
Ejemplo n.º 2
0
 def testWithMultiprocessing(self):
     """Tests that multiprocessing.cpu_count is used."""
     with mock.patch('multiprocessing.cpu_count', lambda: 11):
         self.assertEqual(11, pu.cpu_count())