diff --git a/build/pkgs/pytest/dependencies b/build/pkgs/pytest/dependencies index fd38631bd53..7e5a90a20bd 100644 --- a/build/pkgs/pytest/dependencies +++ b/build/pkgs/pytest/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) pluggy packaging attrs py pyparsing importlib_metadata | $(PYTHON_TOOLCHAIN) +$(PYTHON) pluggy packaging attrs py pyparsing importlib_metadata tomli | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/pytest_xdist/SPKG.rst b/build/pkgs/pytest_xdist/SPKG.rst new file mode 100644 index 00000000000..f962a257b37 --- /dev/null +++ b/build/pkgs/pytest_xdist/SPKG.rst @@ -0,0 +1,18 @@ +pytest_xdist: pytest xdist plugin for distributed testing and loop-on-failing modes +=================================================================================== + +Description +----------- + +pytest xdist plugin for distributed testing and loop-on-failing modes + +License +------- + +MIT + +Upstream Contact +---------------- + +https://pypi.org/project/pytest-xdist/ + diff --git a/build/pkgs/pytest_xdist/dependencies b/build/pkgs/pytest_xdist/dependencies new file mode 100644 index 00000000000..aa8c608f663 --- /dev/null +++ b/build/pkgs/pytest_xdist/dependencies @@ -0,0 +1,4 @@ +$(PYTHON) pytest | $(PYTHON_TOOLCHAIN) + +---------- +All lines of this file are ignored except the first. diff --git a/build/pkgs/pytest_xdist/distros/conda.txt b/build/pkgs/pytest_xdist/distros/conda.txt new file mode 100644 index 00000000000..82d8d43dbd4 --- /dev/null +++ b/build/pkgs/pytest_xdist/distros/conda.txt @@ -0,0 +1 @@ +pytest-xdist diff --git a/build/pkgs/pytest_xdist/requirements.txt b/build/pkgs/pytest_xdist/requirements.txt new file mode 100644 index 00000000000..82d8d43dbd4 --- /dev/null +++ b/build/pkgs/pytest_xdist/requirements.txt @@ -0,0 +1 @@ +pytest-xdist diff --git a/build/pkgs/pytest_xdist/type b/build/pkgs/pytest_xdist/type new file mode 100644 index 00000000000..134d9bc32d5 --- /dev/null +++ b/build/pkgs/pytest_xdist/type @@ -0,0 +1 @@ +optional diff --git a/src/doc/en/developer/tools.rst b/src/doc/en/developer/tools.rst index 705ffcd6431..11e2938400a 100644 --- a/src/doc/en/developer/tools.rst +++ b/src/doc/en/developer/tools.rst @@ -252,13 +252,18 @@ package :mod:`sage.numerical.backends` and some modules in *Installation:* -- ``./sage -i pytest``. +- ``./sage -i pytest pytest_xdist``. *Usage:* - Tox, Sage doctester: At the end of ``./sage -t`` (or ``./sage --tox -e doctest``), Pytest is automatically invoked. -- Manual: Run ``./sage -pytest path/to/the/test_file.py`` or ``./sage -pytest`` to run all tests. +- Manual: Run ``./sage -pytest path/to/the/test_file.py`` or ``./sage -pytest`` + to run all tests. The additional argument ``-n`` can be used to + distribute tests across multiple CPUs to speed up test execution. + For example, ``./sage -pytest -n 4`` will run 4 tests in parallel, while + ``./sage -pytest -n auto`` will spawn a number of workers processes equal + to the number of available CPUs. - VS Code: Install the `Python extension `_ and follow the `offical VS Code documentation `__.