Skip to content

Commit

Permalink
fix: pytest configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
igobranco authored and Tiago-da-silva23 committed Dec 5, 2023
1 parent 67ce772 commit a22553e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ SRC_DIR = src
TEST_DIR = tests
POETRY_RUN = poetry run
DOCKER_COMPOSE = docker-compose
# or use in future the 'pytest' directly
TEST_CMD = $(POETRY_RUN) python manage.py test --settings=nau_financial_manager.test
# TEST_CMD = $(POETRY_RUN) pytest
LINT_CMD = $(POETRY_RUN) black .
PRE_COMMIT = $(POETRY_RUN) pre-commit run --all-files
RUN_CMD = $(POETRY_RUN) python manage.py runserver
Expand Down Expand Up @@ -34,7 +36,7 @@ help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help

test: ## run tests, all or specific test
test: ## run tests, all or a specific test, example: 'make test apps.billing.tests.test_invoice_host_service' or 'pytest apps/billing/tests/test_invoice_host_service.py -k test_get_document_transaction_not_found'
@args="$(filter-out $@,$(MAKECMDGOALS))" && $(TEST_CMD) $${args:-${1}}
.PHONY: test

Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[pytest]
DJANGO_SETTINGS_MODULE = nau_financial_manager.settings
DJANGO_SETTINGS_MODULE = nau_financial_manager.test
python_files = test_*.py

0 comments on commit a22553e

Please sign in to comment.