diff options
author | 2021-06-07 05:28:07 +0300 | |
---|---|---|
committer | 2021-06-07 05:28:29 +0300 | |
commit | 13442f859f452578397766dedc7904928794610a (patch) | |
tree | 52069485875644e07f2733b3b0680f0231ffd33a /tests | |
parent | Merge pull request #1625 from python-discord/docker-compose-restart-policy (diff) |
Switches To Pytest As Test Runner
Switches the test runner from unittest to pytest, to allow the usage of
plugins such as xdist. This commit also adds pytest-cov purely as a
generator for .coverage files.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/README.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/README.md b/tests/README.md index 1a17c09bd..a757f96c6 100644 --- a/tests/README.md +++ b/tests/README.md @@ -11,10 +11,14 @@ We are using the following modules and packages for our unit tests: - [unittest](https://docs.python.org/3/library/unittest.html) (standard library) - [unittest.mock](https://docs.python.org/3/library/unittest.mock.html) (standard library) - [coverage.py](https://coverage.readthedocs.io/en/stable/) +- [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/index.html) + +We also use the following package as a test runner: +- [pytest](https://docs.pytest.org/en/6.2.x/) To ensure the results you obtain on your personal machine are comparable to those generated in the CI, please make sure to run your tests with the virtual environment defined by our [Poetry Project](/pyproject.toml). To run your tests with `poetry`, we've provided two "scripts" shortcuts: -- `poetry run task test` will run `unittest` with `coverage.py` +- `poetry run task test` will run `pytest` with `pytest-cov`. - `poetry run task test path/to/test.py` will run a specific test. - `poetry run task report` will generate a coverage report of the tests you've run with `poetry run task test`. If you append the `-m` flag to this command, the report will include the lines and branches not covered by tests in addition to the test coverage report. |