make running specific unit tests easier (#4336)

I find it's easier to do TDD if i can run specific unit tests. I know
watch is there but some people prefer running their tests manually.
This commit is contained in:
Paresh Mathur 2023-05-10 19:09:22 +05:30 committed by GitHub
parent 80558b5b27
commit 05e749d9fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,11 +32,13 @@ lint lint_diff:
poetry run black $(PYTHON_FILES) --check
poetry run ruff .
TEST_FILE ?= tests/unit_tests/
test:
poetry run pytest tests/unit_tests
poetry run pytest $(TEST_FILE)
tests:
poetry run pytest tests/unit_tests
poetry run pytest $(TEST_FILE)
test_watch:
poetry run ptw --now . -- tests/unit_tests
@ -50,13 +52,14 @@ docker_tests:
help:
@echo '----'
@echo 'coverage - run unit tests and generate coverage report'
@echo 'docs_build - build the documentation'
@echo 'docs_clean - clean the documentation build artifacts'
@echo 'docs_linkcheck - run linkchecker on the documentation'
@echo 'format - run code formatters'
@echo 'lint - run linters'
@echo 'test - run unit tests'
@echo 'test_watch - run unit tests in watch mode'
@echo 'integration_tests - run integration tests'
@echo 'docker_tests - run unit tests in docker'
@echo 'coverage - run unit tests and generate coverage report'
@echo 'docs_build - build the documentation'
@echo 'docs_clean - clean the documentation build artifacts'
@echo 'docs_linkcheck - run linkchecker on the documentation'
@echo 'format - run code formatters'
@echo 'lint - run linters'
@echo 'test - run unit tests'
@echo 'test TEST_FILE=<test_file> - run all tests in file'
@echo 'test_watch - run unit tests in watch mode'
@echo 'integration_tests - run integration tests'
@echo 'docker_tests - run unit tests in docker'