@@ -220,9 +220,6 @@ test_common_py_files := \
220220# Directory for .done files
221221done_dir := done
222222
223- # Determine whether pytest has the --no-print-logs option.
224- pytest_no_log_opt := $(shell pytest --help 2>/dev/null |grep '\--no-print-logs' >/dev/null; if [ $$? -eq 0 ]; then echo '--no-print-logs'; else echo ''; fi)
225-
226223# Flake8 config file
227224flake8_rc_file := .flake8
228225
@@ -256,10 +253,11 @@ check_py_files := \
256253# Packages whose dependencies are checked using pip-missing-reqs
257254check_reqs_packages := pip_check_reqs virtualenv tox pipdeptree build pytest coverage coveralls flake8 ruff pylint jupyter notebook safety bandit towncrier sphinx
258255
256+ pytest_general_opts := -s --color=yes
259257ifdef TESTCASES
260- pytest_opts := $(TESTOPTS ) -k '$(TESTCASES ) '
258+ pytest_test_opts := $(TESTOPTS ) -k '$(TESTCASES ) '
261259else
262- pytest_opts := $(TESTOPTS )
260+ pytest_test_opts := $(TESTOPTS )
263261endif
264262
265263coverage_config_file := .coveragerc
@@ -692,13 +690,13 @@ endif
692690
693691.PHONY : unittest
694692unittest : $(done_dir ) /develop_$(pymn ) _$(PACKAGE_LEVEL ) .done $(package_py_files ) $(test_unit_py_files ) $(test_common_py_files ) $(coverage_config_file )
695- bash -c " PYTHONPATH=. coverage run --append -m pytest --color=yes $( pytest_no_log_opt ) -s $( pytest_opts ) $( test_dir) /unit"
693+ bash -c " PYTHONPATH=. coverage run --append -m pytest $( pytest_general_opts ) $( pytest_test_opts ) $( test_dir) /unit"
696694 coverage html
697695 @echo " Makefile: $@ done."
698696
699697.PHONY : functiontest
700698functiontest : $(done_dir ) /develop_$(pymn ) _$(PACKAGE_LEVEL ) .done $(package_py_files ) $(test_function_py_files ) $(test_function_yaml_files ) $(test_common_py_files ) $(coverage_config_file )
701- bash -c " PYTHONPATH=. coverage run --append -m pytest --color=yes $( pytest_no_log_opt ) -s $( pytest_opts ) $( test_dir) /function"
699+ bash -c " PYTHONPATH=. coverage run --append -m pytest $( pytest_general_opts ) $( pytest_test_opts ) $( test_dir) /function"
702700 coverage html
703701 @echo " Makefile: $@ done."
704702
@@ -717,14 +715,14 @@ endif
717715
718716.PHONY : end2end
719717end2end : $(done_dir ) /develop_$(pymn ) _$(PACKAGE_LEVEL ) .done $(package_py_files ) $(test_end2end_py_files ) $(test_common_py_files ) $(coverage_config_file )
720- bash -c " PYTHONPATH=. TESTEND2END_LOAD=true coverage run --append -m pytest --color=yes $( pytest_no_log_opt ) - v -s - m 'not check_hmcs' $( pytest_opts ) $( test_dir) /end2end"
718+ bash -c " PYTHONPATH=. TESTEND2END_LOAD=true coverage run --append -m pytest -v -m 'not check_hmcs' $( pytest_general_opts ) $( pytest_test_opts ) $( test_dir) /end2end"
721719 coverage html
722720 @echo " Makefile: $@ done."
723721
724722# TODO: Enable rc checking again once the remaining issues are resolved
725723.PHONY : end2end_mocked
726724end2end_mocked : $(done_dir ) /develop_$(pymn ) _$(PACKAGE_LEVEL ) .done $(package_py_files ) $(test_end2end_py_files ) $(test_common_py_files ) $(coverage_config_file ) tests/end2end/mocked_inventory.yaml tests/end2end/mocked_vault.yaml tests/end2end/mocked_hmc_z16.yaml
727- bash -c " PYTHONPATH=. TESTEND2END_LOAD=true TESTINVENTORY=tests/end2end/mocked_inventory.yaml TESTVAULT=tests/end2end/mocked_vault.yaml coverage run --append -m pytest --color=yes $( pytest_no_log_opt ) - v -s - m 'not check_hmcs' $( pytest_opts ) $( test_dir) /end2end"
725+ bash -c " PYTHONPATH=. TESTEND2END_LOAD=true TESTINVENTORY=tests/end2end/mocked_inventory.yaml TESTVAULT=tests/end2end/mocked_vault.yaml coverage run --append -m pytest -v -m 'not check_hmcs' $( pytest_general_opts ) $( pytest_test_opts ) $( test_dir) /end2end"
728726 coverage html
729727 @echo " Makefile: $@ done."
730728
@@ -750,5 +748,5 @@ end2end_show:
750748.PHONY : end2end_check
751749end2end_check : $(done_dir ) /develop_$(pymn ) _$(PACKAGE_LEVEL ) .done $(package_py_files ) $(test_end2end_py_files ) $(test_common_py_files ) $(coverage_config_file )
752750 -$(call RMDIR_R_FUNC,htmlcov.end2end)
753- bash -c " TESTEND2END_LOAD=true TESTCASES=test_hmcdef_check_all_hmcs coverage run --append -m pytest --color=yes $( pytest_no_log_opt ) - v -s - m check_hmcs $( pytest_opts ) $( test_dir) /end2end"
751+ bash -c " TESTEND2END_LOAD=true TESTCASES=test_hmcdef_check_all_hmcs coverage run --append -m pytest -v -m check_hmcs $( pytest_general_opts ) $( pytest_test_opts ) $( test_dir) /end2end"
754752 @echo " Makefile: $@ done."
0 commit comments