Skip to content

Commit b26a1b9

Browse files
committed
extend test_provision_plugin_runner with labels
Run the provisioning environment twice, once with the explicit environment and once passing a label (-m)
1 parent ae523ef commit b26a1b9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/test_provision.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,21 @@ def test_provision_no_recreate_json(tox_project: ToxProjectCreator) -> None:
195195
def test_provision_plugin_runner(tox_project: ToxProjectCreator, tmp_path: Path, plugin_testenv: str) -> None:
196196
"""Ensure that testenv runner doesn't affect the provision env."""
197197
log = tmp_path / "out.log"
198-
proj = tox_project({"tox.ini": f"[tox]\nrequires=demo-pkg-inline\n[{plugin_testenv}]\nrunner=example"})
199-
result_first = proj.run("r", "-e", "py", "--result-json", str(log))
200-
result_first.assert_success()
198+
proj = tox_project(
199+
{"tox.ini": f"[tox]\nrequires=demo-pkg-inline\nlabels=l=py\n[{plugin_testenv}]\nrunner=example"},
200+
)
201201
prov_msg = (
202202
f"ROOT: will run in automatically provisioned tox, host {sys.executable} is missing"
203203
f" [requires (has)]: demo-pkg-inline"
204204
)
205-
assert prov_msg in result_first.out
205+
206+
result_env = proj.run("r", "-e", "py", "--result-json", str(log))
207+
result_env.assert_success()
208+
assert prov_msg in result_env.out
209+
210+
result_label = proj.run("r", "-m", "l", "--result-json", str(log))
211+
result_label.assert_success()
212+
assert prov_msg in result_label.out
206213

207214

208215
@pytest.mark.integration()

0 commit comments

Comments
 (0)