From 266b114332e9c2302857f869ca2c20120da23baf Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Mon, 3 May 2021 20:50:35 +0200 Subject: [PATCH] [doc] #103: Update and refactor Tests section with pytest usage Move to CONTRIBUTING.md --- CONTRIBUTING.md | 17 +++++++++++++++++ README.md | 10 ---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc695d8c..09d17db8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. 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 To handle a release, you have to respect this workflow: diff --git a/README.md b/README.md index 1b3be0e1..aa71f20b 100644 --- a/README.md +++ b/README.md @@ -111,16 +111,6 @@ poetry install 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 ### PyPI Change and commit and tag the new version number (semantic version number) -- GitLab