aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2021-06-07 05:58:57 +0300
committerGravatar Hassan Abouelela <[email protected]>2021-06-07 05:58:57 +0300
commit37584a8b8774c04b4111c29d96f8d06b31c89d84 (patch)
tree5874ffa2cc23010afe364def8a3c755dc6d11eee
parentSwitches To Pytest As Test Runner (diff)
Adds Fast-Test Task
Signed-off-by: Hassan Abouelela <[email protected]>
-rw-r--r--pyproject.toml3
-rw-r--r--tests/README.md1
2 files changed, 3 insertions, 1 deletions
diff --git a/pyproject.toml b/pyproject.toml
index 2c9181889..774fe075c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -61,6 +61,7 @@ lint = "pre-commit run --all-files"
precommit = "pre-commit install"
build = "docker build -t ghcr.io/python-discord/bot:latest -f Dockerfile ."
push = "docker push ghcr.io/python-discord/bot:latest"
-test = "pytest -n auto --cov-report= --cov bot "
+fast-test = "pytest -n auto"
+test = "pytest -n auto --cov-report= --cov bot"
html = "coverage html"
report = "coverage report"
diff --git a/tests/README.md b/tests/README.md
index a757f96c6..b5fba9611 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -18,6 +18,7 @@ We also use the following package as a test runner:
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 fast-test` will run `pytest`.
- `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.