From 4e1d5f80f0c589b531ec790b195a916e44c91121 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 29 May 2019 22:57:38 -0400 Subject: Forcefully uninstall packages; with pip fallback * write xunit2 data back to the config file --- source/merge.d | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source/merge.d') diff --git a/source/merge.d b/source/merge.d index 6d78978..96773a6 100644 --- a/source/merge.d +++ b/source/merge.d @@ -177,7 +177,9 @@ auto integration_test(ref Conda conda, string outdir, test_runner_t runner, test string[] tmp = found.split("-"); found = tmp[0]; // Does not need to succeed for all matches - conda.run("remove " ~ found); + if (conda.run("remove --force " ~ found)) { + conda.sh("python -m pip uninstall -y " ~ repo_root.baseName.replace("-", "_")); + } } if (runner.requires) { @@ -195,11 +197,13 @@ auto integration_test(ref Conda conda, string outdir, test_runner_t runner, test } if (runner.program == "pytest" || runner.program == "py.test") { - string testconf = "pytest.ini"; - if (!testconf.exists) { - testconf = "setup.cfg"; + string data; + string pytest_cfg= "pytest.ini"; + if (!pytest_cfg.exists) { + pytest_cfg = "setup.cfg"; } - pytest_xunit2(testconf); + data = pytest_xunit2(pytest_cfg); + File(pytest_cfg, "w+").write(data); } if (conda.sh(runner.program ~ " " ~ runner.args ~ " --basetemp=" ~ basetemp)) { -- cgit