Skip to content
Snippets Groups Projects
Commit 266b1143 authored by Moul's avatar Moul
Browse files

[doc] #103: Update and refactor Tests section with pytest usage

Move to CONTRIBUTING.md
parent 6648a89f
No related branches found
No related tags found
No related merge requests found
Pipeline #12558 passed
...@@ -25,6 +25,23 @@ poetry run black duniterpy/file.py ...@@ -25,6 +25,23 @@ poetry run black duniterpy/file.py
With `pre-commit`, Black is called on staged files, so the commit should fail in case black would make changes. With `pre-commit`, Black is called on staged files, so the commit should fail in case black would make changes.
You will have to add Black changes in order to commit your changes. You will have to add Black changes in order to commit your changes.
## Tests
We are using [`pytest` framework](https://docs.pytest.org/).
- Run all tests with:
```bash
duniterpy> poetry run pytest
```
- Run specific tests by specifying the path to a file:
```bash
duniterpy> poetry run pytest tests/helpers/test_ws2p.py
```
- You can even specify a test from the selected file:
```bash
duniterpy> poetry run pytest tests/helpers/test_ws2p.py::test_generate_ws2p_endpoint
## Release workflow ## Release workflow
To handle a release, you have to respect this workflow: To handle a release, you have to respect this workflow:
......
...@@ -111,16 +111,6 @@ poetry install ...@@ -111,16 +111,6 @@ poetry install
make check make check
``` ```
* Run all unit tests (builtin `unittest` module) with:
```bash
make tests
```
* Run only some unit tests by passing a special ENV variable:
```bash
make tests TESTS_FILTER=tests.documents.test_block.TestBlock.test_fromraw
```
## Packaging and deploy ## Packaging and deploy
### PyPI ### PyPI
Change and commit and tag the new version number (semantic version number) Change and commit and tag the new version number (semantic version number)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment