def test_ok(self): cfile = create_config(("workers=4",)) conf = Config(cfile).load() with mock.patch("multiprocessing.cpu_count", return_value=4): conf.test_workers() assert conf.workers is 4
def test_ok(self): cfile = create_config(("workers=4", )) conf = Config(cfile).load() with mock.patch("multiprocessing.cpu_count", return_value=4): conf.test_workers() assert conf.workers is 4
def test_more_than_cpus(self): conf = Config(None).load() with mock.patch( "multiprocessing.cpu_count", return_value=0 ), pytest.raises(ConfigException): conf.test_workers()
def test_more_than_cpus(self): conf = Config(None).load() with mock.patch("multiprocessing.cpu_count", return_value=0), pytest.raises(ConfigException): conf.test_workers()