diff --git a/.azure-pipelines/ci-conda-env.txt b/.azure-pipelines/ci-conda-env.txt index bb73e6c19..15e08494e 100644 --- a/.azure-pipelines/ci-conda-env.txt +++ b/.azure-pipelines/ci-conda-env.txt @@ -22,7 +22,6 @@ conda-forge::orderedset conda-forge::pillow>=5.4.1 conda-forge::pint conda-forge::pip -conda-forge::procrunner conda-forge::psutil conda-forge::pyrtf conda-forge::pybind11 diff --git a/libtbx_config b/libtbx_config index 0f9b1ae2e..e511ce2b2 100644 --- a/libtbx_config +++ b/libtbx_config @@ -3,7 +3,6 @@ "python_required": [ "dials-data>=2.0.30", "pint", - "procrunner>=1.0.2", "pytest>=4.5,<5.0", ], } diff --git a/newsfragments/640.misc b/newsfragments/640.misc new file mode 100644 index 000000000..8183d5860 --- /dev/null +++ b/newsfragments/640.misc @@ -0,0 +1 @@ +Use Python built-in ``subprocess`` in place of external dependency ``procrunner`` for running CLI tests. diff --git a/tests/command_line/test_average.py b/tests/command_line/test_average.py index 38d1c901e..bedbc2d48 100644 --- a/tests/command_line/test_average.py +++ b/tests/command_line/test_average.py @@ -1,13 +1,15 @@ from __future__ import annotations -import procrunner +import shutil +import subprocess + import pytest import dxtbx @pytest.mark.parametrize("use_mpi", [True, False]) -def test_average(dials_data, tmpdir, use_mpi): +def test_average(dials_data, tmp_path, use_mpi): # averager uses cbf handling code in the xfel module pytest.importorskip("xfel") @@ -22,16 +24,16 @@ def test_average(dials_data, tmpdir, use_mpi): command = "mpirun" mpargs = "-n 2 dxtbx.image_average --mpi=True".split() else: - command = "dxtbx.image_average" + command = shutil.which("dxtbx.image_average") mpargs = "-n 2".split() - result = procrunner.run( + result = subprocess.run( [command] + mpargs + "-v -a avg.cbf -s stddev.cbf -m max.cbf".split() + [data], - working_directory=tmpdir, + cwd=tmp_path, ) assert not result.returncode and not result.stderr h5 = dxtbx.load(data).get_detector() - cbf = dxtbx.load(tmpdir.join("avg.cbf")).get_detector() + cbf = dxtbx.load(tmp_path / "avg.cbf").get_detector() assert h5.is_similar_to(cbf) assert h5[0].get_gain() == cbf[0].get_gain()