Skip to content

Commit 9d87ab9

Browse files
committed
docs: migrate test documentation from README_TESTS.md to CONTRIBUTING.rst
Move all test running instructions to CONTRIBUTING.rst under a new 'Running Tests' section with subsections for: - Quick Start (Using Make) - Manual Test Commands - All Test Commands - Using tox - Continuous Integration This consolidates test documentation in the standard CONTRIBUTING.rst location where developers expect to find contribution guidelines. Remove README_TESTS.md after content migration to avoid duplication. Keep tests/conftest.py as it's required for nocov test mode where the package is not installed in editable mode (usedevelop=false in tox.ini).
1 parent e1de9ee commit 9d87ab9

File tree

2 files changed

+85
-86
lines changed

2 files changed

+85
-86
lines changed

CONTRIBUTING.rst

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,80 @@ For merging, you should:
7373
3. Add a note to ``CHANGELOG.rst`` about the changes.
7474
4. Add yourself to ``AUTHORS.rst``.
7575

76-
Tips
77-
----
76+
Running Tests
77+
-------------
78+
79+
Quick Start (Using Make)
80+
~~~~~~~~~~~~~~~~~~~~~~~~
81+
82+
The easiest way to run tests::
83+
84+
# First time setup - create virtual environment
85+
make venv
86+
source .venv/bin/activate
87+
88+
# Install dependencies
89+
make install
90+
91+
# Run all tests
92+
make test
93+
94+
# Run just the catalog vendor tests
95+
make test-vendor
96+
97+
# Run tests with coverage
98+
make test-cov
99+
100+
Manual Test Commands
101+
~~~~~~~~~~~~~~~~~~~~
102+
103+
If you prefer to run pytest directly::
104+
105+
# Activate virtual environment
106+
source .venv/bin/activate
107+
108+
# Run catalog extra fields tests
109+
python -m pytest tests/test_vendor/test_catalog_v1.py -v
110+
111+
All Test Commands
112+
~~~~~~~~~~~~~~~~~
113+
114+
::
115+
116+
# Run all catalog vendor tests
117+
python -m pytest tests/test_vendor/ -v
118+
119+
# Run specific test file
120+
python -m pytest tests/test_vendor/test_catalog_v1.py -v
121+
122+
# Run specific test class
123+
python -m pytest tests/test_vendor/test_catalog_v1.py::TestMetadataExtraFields -v
124+
125+
# Run specific test method
126+
python -m pytest tests/test_vendor/test_catalog_v1.py::TestMetadataExtraFields::test_metadata_accepts_extra_fields -v
127+
128+
# Run with more verbose output
129+
python -m pytest tests/test_vendor/test_catalog_v1.py -vv
130+
131+
# Run and show print statements
132+
python -m pytest tests/test_vendor/test_catalog_v1.py -v -s
133+
134+
# Run all tests in the project
135+
python -m pytest tests/ -v
136+
137+
Using tox
138+
~~~~~~~~~
139+
140+
The GitHub Actions CI uses tox to run tests across multiple Python and Pydantic versions::
141+
142+
# Run tests with Python 3.10 and Pydantic 2.10 (no coverage)
143+
python3 -m tox -e py310-pydantic210-nocov
144+
145+
# Run tests with coverage
146+
python3 -m tox -e py310-pydantic210-cover
147+
148+
# Run specific tests with tox
149+
python3 -m tox -e py310-pydantic210-nocov -- tests/test_vendor/test_catalog_v1.py
78150

79151
To run a subset of tests::
80152

@@ -83,3 +155,14 @@ To run a subset of tests::
83155
To run all the test environments in *parallel*::
84156

85157
tox -p auto
158+
159+
Continuous Integration
160+
~~~~~~~~~~~~~~~~~~~~~~
161+
162+
Tests run automatically on every push and pull request via GitHub Actions (``.github/workflows/github-actions.yml``).
163+
164+
The CI runs tests across:
165+
166+
* Python versions: 3.10, 3.11, 3.12, PyPy 3.9
167+
* Pydantic versions: 2.8, 2.10
168+
* With and without coverage reports

README_TESTS.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)