From 4290b111c4e89b03fbd01d4b6478ec41d5c4b142 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sat, 14 May 2022 09:51:34 +0000 Subject: [PATCH 1/3] Add pytest-xdist package --- build/pkgs/pytest_xdist/SPKG.rst | 18 ++++++++++++++++++ build/pkgs/pytest_xdist/dependencies | 4 ++++ build/pkgs/pytest_xdist/distros/conda.txt | 1 + build/pkgs/pytest_xdist/requirements.txt | 1 + build/pkgs/pytest_xdist/type | 1 + src/doc/en/developer/tools.rst | 9 +++++++-- 6 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 build/pkgs/pytest_xdist/SPKG.rst create mode 100644 build/pkgs/pytest_xdist/dependencies create mode 100644 build/pkgs/pytest_xdist/distros/conda.txt create mode 100644 build/pkgs/pytest_xdist/requirements.txt create mode 100644 build/pkgs/pytest_xdist/type 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..0738c2d7777 --- /dev/null +++ b/build/pkgs/pytest_xdist/dependencies @@ -0,0 +1,4 @@ +$(PYTHON) | $(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 `__. From a365828e4f08db6b5a86a3d03361017beeb001d8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 14 May 2022 11:44:05 -0700 Subject: [PATCH 2/3] build/pkgs/pytest/dependencies: Add missing dep --- build/pkgs/pytest/dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From a2e396beb6c73f817388e3a117c73104a03da99b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 14 May 2022 11:44:20 -0700 Subject: [PATCH 3/3] build/pkgs/pytest_xdist/dependencies: Add missing dep --- build/pkgs/pytest_xdist/dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/pytest_xdist/dependencies b/build/pkgs/pytest_xdist/dependencies index 0738c2d7777..aa8c608f663 100644 --- a/build/pkgs/pytest_xdist/dependencies +++ b/build/pkgs/pytest_xdist/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) pytest | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first.