Commit dec24561 authored by jiaruifang's avatar jiaruifang Committed by Frank Lee
Browse files

show pytest parameterize

parent 11bddb6e
...@@ -33,11 +33,11 @@ def run_dist(rank, world_size, port): ...@@ -33,11 +33,11 @@ def run_dist(rank, world_size, port):
@pytest.mark.dist @pytest.mark.dist
def test_zero_init_context(): @pytest.mark.parametrize("world_size", [1, 2, 4])
world_size = 2 def test_zero_init_context(world_size):
run_func = partial(run_dist, world_size=world_size, port=free_port()) run_func = partial(run_dist, world_size=world_size, port=free_port())
mp.spawn(run_func, nprocs=world_size) mp.spawn(run_func, nprocs=world_size)
if __name__ == '__main__': if __name__ == '__main__':
test_zero_init_context() test_zero_init_context(2)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment