File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Python Tests
22
3- based on pytest.
3+ Tests are managed via [ Hatch ] ( https://hatch.pypa.io/ ) and run with pytest.
44
55## Running Tests
66
7- Make sure to install test dependencies: ` pip install -r requirements-test.txt ` .
8-
97### All Tests
108
119``` bash
12- pytest
10+ hatch test
1311```
1412
13+ ### Target a specific Python version
14+
15+ ``` bash
16+ hatch test --python 3.11
17+ hatch test --python 3.13
18+ ```
1519
1620### Specific Test File
21+
1722``` bash
18- pytest tests/test_yaml_parser.py -v
23+ hatch test -- tests/test_yaml_parser.py -v
1924```
2025
2126### Specific Test Class
27+
2228``` bash
23- pytest tests/test_yaml_parser.py::TestYamlParser -v
29+ hatch test -- tests/test_yaml_parser.py::TestYamlParser -v
2430```
2531
2632### Specific Test Function
33+
34+ ``` bash
35+ hatch test -- tests/test_yaml_parser.py::TestYamlParser::test_yaml_parser_basic_functionality -v
36+ ```
37+
38+ ### Full CI invocation
39+
2740``` bash
28- pytest tests/test_yaml_parser.py::TestYamlParser::test_yaml_parser_basic_functionality -v
41+ hatch fmt --linter --check
42+ hatch test --python 3.11 --cover --randomize --parallel --retries 2 --retry-delay 1
2943```
3044
3145## Test Configuration
3246
33- See ` pytest.ini ` in the root directory .
47+ See ` [tool.hatch] ` and ` [tool.coverage] ` sections in ` pyproject.toml ` .
You can’t perform that action at this time.
0 commit comments