diff options
-rw-r--r-- | pyproject.toml | 6 | ||||
-rw-r--r-- | tests/README.md | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/pyproject.toml b/pyproject.toml index 1a52d7850..b0012d4ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,9 +56,9 @@ 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-nocov = "pytest -n auto" -test = "pytest -n auto --cov-report= --cov --ff" -retest = "pytest -n auto --cov-report= --cov --lf" +test = "pytest -n auto --ff" +retest = "pytest -n auto --lf" +test-cov = "pytest -n auto --cov-report= --cov" html = "coverage html" report = "coverage report" isort = "isort ." diff --git a/tests/README.md b/tests/README.md index b7fddfaa2..5052c8381 100644 --- a/tests/README.md +++ b/tests/README.md @@ -26,12 +26,12 @@ 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 the following "script" shortcuts: -- `poetry run task test-nocov` will run `pytest`. -- `poetry run task test` will run `pytest` with `pytest-cov`. +- `poetry run task test` will run `pytest`. - `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. +- `poetry run task test-cov` will run `pytest` with `pytest-cov`. +- `poetry run task report` will generate a coverage report of the tests you've run with `poetry run task test-cov`. 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. -If you want a coverage report, make sure to run the tests with `poetry run task test` *first*. +If you want a coverage report, make sure to run the tests with `poetry run task test-cov` *first*. ## Running tests There are multiple ways to run the tests, which one you use will be determined by your goal, and stage in development. @@ -39,12 +39,12 @@ There are multiple ways to run the tests, which one you use will be determined b When actively developing, you'll most likely be working on one portion of the codebase, and as a result, won't need to run the entire test suite. To run just one file, and save time, you can use the following command: ```shell -poetry run task test-nocov <path/to/file.py> +poetry run task test <path/to/file.py> ``` For example: ```shell -poetry run task test-nocov tests/bot/exts/test_cogs.py +poetry run task test tests/bot/exts/test_cogs.py ``` will run the test suite in the `test_cogs` file. |