diff --git a/tests/integration/plugins/test_poetry.py b/tests/integration/plugins/test_poetry.py index 454b00c5..fc3e8f0e 100644 --- a/tests/integration/plugins/test_poetry.py +++ b/tests/integration/plugins/test_poetry.py @@ -242,7 +242,12 @@ def _get_system_python_interpreter(self) -> str | None: actions = lf.plan(Step.PRIME) out = pathlib.Path("out.txt") - with out.open(mode="w") as outfile, err.open(mode="w") as errfile, pytest.raises(errors.PluginBuildError): + err = pathlib.Path("err.txt") + with ( + out.open(mode="w") as outfile, + err.open(mode="w") as errfile, + pytest.raises(errors.PluginBuildError), + ): with lf.action_executor() as ctx: ctx.execute(actions, stdout=outfile, stderr=errfile) @@ -255,12 +260,7 @@ def _get_system_python_interpreter(self) -> str | None: assert expected_text in output output = err.read_text() - expected_text = textwrap.dedent( - f"""\ - No suitable Python interpreter found, giving up. - """ - ) - assert expected_text in output + assert "No suitable Python interpreter found, giving up." in output def test_find_payload_python_good_version(new_dir, partitions, parts_dict, poetry_part): diff --git a/tests/integration/plugins/test_python.py b/tests/integration/plugins/test_python.py index 690f6fd5..c50b09ee 100644 --- a/tests/integration/plugins/test_python.py +++ b/tests/integration/plugins/test_python.py @@ -323,7 +323,11 @@ def _get_system_python_interpreter(self) -> str | None: out = Path("out.txt") err = Path("err.txt") - with out.open(mode="w") as outfile, err.open(mode="w") as errfile, pytest.raises(errors.PluginBuildError): + with ( + out.open(mode="w") as outfile, + err.open(mode="w") as errfile, + pytest.raises(errors.PluginBuildError), + ): with lf.action_executor() as ctx: ctx.execute(actions, stdout=outfile, stderr=errfile) @@ -336,12 +340,7 @@ def _get_system_python_interpreter(self) -> str | None: assert expected_text in output output = err.read_text() - expected_text = textwrap.dedent( - f"""\ - No suitable Python interpreter found, giving up. - """ - ) - assert expected_text in output + assert "No suitable Python interpreter found, giving up." in output def test_find_payload_python_good_version(new_dir, partitions):