Skip to content

Commit 79371fe

Browse files
author
Mauko Quiroga
committed
Add test-built task
1 parent b69236f commit 79371fe

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

tasks/publish.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ build:
2424

2525
## Upload openfisca-core package to PyPi.
2626
publish:
27+
@$(call print_help,$@:)
2728
@twine upload dist/* --username $${PYPI_USERNAME} --password $${PYPI_PASSWORD}
29+
@$(call print_pass,$@:)

tasks/test_code.mk

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## The path to the installed packages.
2+
python_packages = $(shell python -c "import sysconfig; print(sysconfig.get_paths()[\"purelib\"])")
3+
14
## Run openfisca-core.
25
test-code: test-core
36
@## Usage:
@@ -13,9 +16,24 @@ test-code: test-core
1316
@$(call print_pass,$@:)
1417

1518
## Run openfisca-core tests.
16-
test-core: $(shell git ls-files "tests/*.py")
19+
test-core:
20+
@$(call print_help,$@:)
21+
@PYTEST_ADDOPTS="\
22+
${PYTEST_ADDOPTS} \
23+
--cov=src \
24+
${pytest_args} \
25+
" \
26+
openfisca test $(shell find tests -name "*.py") ${openfisca_args}
27+
@$(call print_pass,$@:)
28+
29+
## Run openfisca-core tests against the built version.
30+
test-built:
1731
@$(call print_help,$@:)
18-
@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=src ${pytest_args}" \
19-
openfisca test $? \
20-
${openfisca_args}
32+
@PYTEST_ADDOPTS=" \
33+
${PYTEST_ADDOPTS} \
34+
--cov=${python_packages}/openfisca_core \
35+
--cov=${python_packages}/openfisca_web_api \
36+
${pytest_args} \
37+
" \
38+
openfisca test $(shell find tests -name "*.py") ${openfisca_args}
2139
@$(call print_pass,$@:)

0 commit comments

Comments
 (0)