def test_no_thread_pool(): pool = xmon_stepper.ThreadlessPool() result = pool.map(lambda x: x + 1, range(10)) assert result == [x + 1 for x in range(10)] # No ops. pool.terminate() pool.join()
def test_no_thread_pool_no_chunking(): pool = xmon_stepper.ThreadlessPool() with pytest.raises(AssertionError): pool.map(lambda x: x + 1, range(10), chunksize=1)