Make "-nX" and "--dist=loadscope" work properly together
This commit is contained in:
@@ -727,7 +727,7 @@ class TestLoadScope:
|
||||
test_a=test_file,
|
||||
test_b=test_file,
|
||||
)
|
||||
result = testdir.runpytest('--tx=2*popen', '--dist=loadscope', '-v')
|
||||
result = testdir.runpytest('-n2', '--dist=loadscope', '-v')
|
||||
assert get_workers_and_test_count_by_prefix('test_a.py::test', result.outlines) == {'gw0': 10}
|
||||
assert get_workers_and_test_count_by_prefix('test_b.py::test', result.outlines) == {'gw1': 10}
|
||||
|
||||
@@ -744,7 +744,7 @@ class TestLoadScope:
|
||||
def test(self, i):
|
||||
pass
|
||||
""")
|
||||
result = testdir.runpytest('--tx=2*popen', '--dist=loadscope', '-v')
|
||||
result = testdir.runpytest('-n2', '--dist=loadscope', '-v')
|
||||
assert get_workers_and_test_count_by_prefix('test_a.py::TestA', result.outlines) == {'gw0': 10}
|
||||
assert get_workers_and_test_count_by_prefix('test_a.py::TestB', result.outlines) == {'gw1': 10}
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ def pytest_configure(config):
|
||||
@pytest.mark.tryfirst
|
||||
def pytest_cmdline_main(config):
|
||||
if config.option.numprocesses:
|
||||
if config.option.dist == 'no':
|
||||
config.option.dist = "load"
|
||||
config.option.tx = ['popen'] * config.option.numprocesses
|
||||
if config.option.distload:
|
||||
|
||||
Reference in New Issue
Block a user