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 black $(PYTHON_FILES) --check
poetry run ruff . poetry run ruff .
TEST_FILE ?= tests/unit_tests/
test: test:
poetry run pytest tests/unit_tests poetry run pytest $(TEST_FILE)
tests: tests:
poetry run pytest tests/unit_tests poetry run pytest $(TEST_FILE)
test_watch: test_watch:
poetry run ptw --now . -- tests/unit_tests poetry run ptw --now . -- tests/unit_tests
@ -57,6 +59,7 @@ help:
@echo 'format - run code formatters' @echo 'format - run code formatters'
@echo 'lint - run linters' @echo 'lint - run linters'
@echo 'test - run unit tests' @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 'test_watch - run unit tests in watch mode'
@echo 'integration_tests - run integration tests' @echo 'integration_tests - run integration tests'
@echo 'docker_tests - run unit tests in docker' @echo 'docker_tests - run unit tests in docker'