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

Method test_cpu_count_default

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

Source from the content-addressed store, hash-verified

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())"
1189 res = assert_python_ok('-X', 'cpu_count=default', '-c', code)
1190 self.assertEqual(self.res2int(res), (os.cpu_count(), os.process_cpu_count()))
1191 res = assert_python_ok('-X', 'cpu_count=default', '-c', code, PYTHON_CPU_COUNT='1234')
1192 self.assertEqual(self.res2int(res), (os.cpu_count(), os.process_cpu_count()))
1193 res = assert_python_ok('-c', code, PYTHON_CPU_COUNT='default')
1194 self.assertEqual(self.res2int(res), (os.cpu_count(), os.process_cpu_count()))
1195
1196 def test_import_time(self):
1197 # os is not imported at startup

Callers

nothing calls this directly

Calls 4

res2intMethod · 0.95
assert_python_okFunction · 0.90
cpu_countMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected