@@ -8,37 +8,48 @@ Python tests use the `pytest`_ framework,
88`flake8 `_ and `isort `_ check the code formatting,
99and the documentation is build using `sphinx `_
1010
11- Setup
12- =====
11+ Using tox
12+ =========
1313
14- To install all the testing tools,
15- install ``emsarray `` in to a virtual environment with the ``[testing] `` extra.
14+ The easiest way to install all the test requirements is using Conda:
1615
17- .. code-block :: shell-session
16+ * Make a new Conda environment,
17+ * install the required packages using the provided environment file,
18+ * install Python and tox.
1819
19- $ python3 -m venv venv
20- $ source venv/bin/activate
21- $ pip3 install --upgrade pip
22- $ pip3 install -r requirements.txt -e .[testing]
20+ .. code-block :: shell-session
2321
24- Running all the tests
25- =====================
22+ $ conda env create --name 'emsarray-tests-py3.12' --file continuous-integration/environment.yaml
23+ $ conda activate emsarray-tests-py3.12
24+ $ conda install -c conda-forge python==3.12 tox
2625
2726 Invoke ``tox `` to run all the tests:
2827
2928.. code-block :: shell-session
3029
31- $ tox
30+ $ tox run -e py312-pytest-latest py312-pytest-pinned lint docs
3231
33- Running Python tests
34- ====================
32+ Note that this should only be used to run tests for the version of Python you
33+ installed in your Conda environment.
34+
35+ Using pytest
36+ ============
3537
3638You can invoke ``pytest `` directly to run just a subset of the tests.
37- For example, to only run the tests in ``tests/operations.py ``:
39+ Set up a new Conda environment, then install `emsarray ` with the `testing ` extra:
40+
41+ .. code-block :: shell-session
42+
43+ $ conda env create --name 'emsarray-development' --file continuous-integration/environment.yaml
44+ $ conda activate emsarray-development
45+ $ conda install -c conda-forge python=3.12 pip
46+ $ pip install -e .[testing]
47+
48+ Invoke ``pytest `` to run the tests:
3849
3950.. code-block :: shell-session
4051
41- $ pytest tests/test_operations.py
52+ $ pytest
4253
4354 .. _tox : https://tox.wiki/
4455.. _pytest : https://pytest.org/
0 commit comments