1
0
Fork 0
mirror of https://github.com/qurator-spk/dinglehopper.git synced 2025-07-10 19:09:58 +02:00
dinglehopper/README-DEV.md

46 lines
831 B
Markdown
Raw Normal View History

Testing
=======
2023-03-27 18:25:39 +02:00
Use `pytest` to run the tests in [the tests directory](dinglehopper/tests):
```bash
virtualenv -p /usr/bin/python3 venv
. venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
pytest
```
## Test running examples
Only unit tests:
```bash
pytest -m "not integration"
```
Only integration tests:
```bash
pytest -m integration
```
All tests:
```bash
pytest
```
All tests with code coverage:
```bash
2023-03-27 18:25:39 +02:00
pytest --cov=dinglehopper --cov-report=html
```
Static code analysis:
```bash
pytest -k "not test" --mypy
pytest -k "not test" --ruff
```
2023-08-03 19:13:21 +02:00
# How to use pre-commit
2023-08-03 19:13:21 +02:00
This project optionally uses [pre-commit](https://pre-commit.com) to check commits. To use it:
- Install pre-commit, e.g. `pip install -r requirements-dev.txt`
- Install the repo-local git hooks: `pre-commit install`