MCPcopy Index your code
hub / github.com/python/cpython / test_cpu_count

Method test_cpu_count

Lib/test/test_cmd_line.py:1180–1185  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1178 assert_python_failure('-c', code)
1179
1180 def test_cpu_count(self):
1181 code = "import os; print(os.cpu_count(), os.process_cpu_count())"
1182 res = assert_python_ok('-X', 'cpu_count=4321', '-c', code)
1183 self.assertEqual(self.res2int(res), (4321, 4321))
1184 res = assert_python_ok('-c', code, PYTHON_CPU_COUNT='1234')
1185 self.assertEqual(self.res2int(res), (1234, 1234))
1186
1187 def test_cpu_count_default(self):
1188 code = "import os; print(os.cpu_count(), os.process_cpu_count())"

Callers

nothing calls this directly

Calls 3

res2intMethod · 0.95
assert_python_okFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected