Skip to content

Commit d9bf7a3

Browse files
author
Mauko Quiroga
committed
Test country & extension templates
1 parent 443bb44 commit d9bf7a3

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
- /tmp/venv/openfisca_core
3131

3232
- run:
33-
name: Run Core tests
34-
command: env PYTEST_ADDOPTS="--exitfirst" make test
33+
name: Run tests
34+
command: make test pytest_addopts="--cov=openfisca_core --exitfirst"
3535

3636
- run:
3737
name: Check NumPy typing against latest 3 minor versions
@@ -42,12 +42,6 @@ jobs:
4242
paths:
4343
- .coverage
4444

45-
- run:
46-
name: Run Country Template tests
47-
command: |
48-
COUNTRY_TEMPLATE_PATH=`python -c "import openfisca_country_template; print(openfisca_country_template.CountryTaxBenefitSystem().get_package_metadata()['location'])"`
49-
openfisca test $COUNTRY_TEMPLATE_PATH/openfisca_country_template/tests/
50-
5145
check_version:
5246
docker:
5347
- image: python:3.7

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
COUNTRY_TEMPLATE := openfisca_country_template
2+
EXTENSION_TEMPLATE := openfisca_extension_template
3+
PYTHON_PACKAGES_PATH := $(shell python -c "import sysconfig; print(sysconfig.get_paths()[\"purelib\"])")
4+
COUNTRY_TEMPLATE_TESTS := ${PYTHON_PACKAGES_PATH}/${COUNTRY_TEMPLATE}/tests
5+
EXTENSION_TEMPLATE_TESTS := ${PYTHON_PACKAGES_PATH}/${EXTENSION_TEMPLATE}/tests
6+
17
all: test
28

39
uninstall:
@@ -9,7 +15,7 @@ install:
915

1016
clean:
1117
rm -rf build dist
12-
find . -name '*.pyc' -exec rm \{\} \;
18+
find . -name "*.pyc" -exec rm \{\} \;
1319

1420
check-syntax-errors:
1521
python -m compileall -q .
@@ -28,7 +34,9 @@ format-style:
2834
autopep8 `git ls-files | grep "\.py$$"`
2935

3036
test: clean check-syntax-errors check-style check-types
31-
env PYTEST_ADDOPTS="$$PYTEST_ADDOPTS --cov=openfisca_core" pytest
37+
PYTEST_ADDOPTS="$$PYTEST_ADDOPTS ${pytest_addopts}" pytest
38+
openfisca test ${COUNTRY_TEMPLATE_TESTS} -c ${COUNTRY_TEMPLATE} ${optional_arguments}
39+
openfisca test ${EXTENSION_TEMPLATE_TESTS} -c ${COUNTRY_TEMPLATE} -e ${EXTENSION_TEMPLATE} ${optional_arguments}
3240

33-
api:
34-
openfisca serve --country-package openfisca_country_template --extensions openfisca_extension_template
41+
serve:
42+
openfisca serve -c ${COUNTRY_TEMPLATE} -e ${EXTENSION_TEMPLATE} ${optional_arguments}

0 commit comments

Comments
 (0)