diff --git a/.github/actions/run_tests/entrypoint.sh b/.github/actions/run_tests/entrypoint.sh index 6c5da65ea2..bd2aa579dc 100644 --- a/.github/actions/run_tests/entrypoint.sh +++ b/.github/actions/run_tests/entrypoint.sh @@ -61,7 +61,7 @@ if [[ "$INPUT_CATEGORIES" == pytests* ]]; then for x in `cat $PYTESTS_GROUPS_FILEPATH`; do marker="${x//_or_/ or }" marker="${marker//not_/not }" - command+="/usr/local/conda/envs/${METPLUS_ENV_TAG}/bin/pytest -vv --cov=../../../metplus -m \"$marker\"" + command+="/usr/local/conda/envs/${METPLUS_ENV_TAG}/bin/pytest -vv --cov=../../../metplus --cov-append -m \"$marker\"" command+=";if [ \$? != 0 ]; then status=1; fi;" done command+="if [ \$status != 0 ]; then echo ERROR: Some pytests failed. Search for FAILED to review; false; fi" diff --git a/internal/tests/pytests/util/config_metplus/test_config_metplus.py b/internal/tests/pytests/util/config_metplus/test_config_metplus.py index 8dda66dea1..ca6daf44f6 100644 --- a/internal/tests/pytests/util/config_metplus/test_config_metplus.py +++ b/internal/tests/pytests/util/config_metplus/test_config_metplus.py @@ -162,8 +162,8 @@ def test_find_var_indices_fcst(metplus_config, ) @pytest.mark.util def test_get_field_search_prefixes(data_type, met_tool, expected_out): - assert(config_metplus.get_field_search_prefixes(data_type, - met_tool) == expected_out) + assert(config_metplus._get_field_search_prefixes(data_type, + met_tool) == expected_out) # search prefixes are valid prefixes to append to field info variables diff --git a/internal/tests/pytests/util/string_manip/test_util_string_manip.py b/internal/tests/pytests/util/string_manip/test_util_string_manip.py index d53f19b469..38eb260440 100644 --- a/internal/tests/pytests/util/string_manip/test_util_string_manip.py +++ b/internal/tests/pytests/util/string_manip/test_util_string_manip.py @@ -8,6 +8,18 @@ from metplus.util.string_manip import * from metplus.util.string_manip import _fix_list +@pytest.mark.parametrize( + 'template, expected_output', [ + ('', ''), + ('{init?fmt=%Y%m%d}_i{init?fmt=%H%M}_m0_f*', + r'{init?fmt=%Y%m%d}_i{init?fmt=%H%M}_m0_f*'), + ('pgbf{lead?fmt=%HHH}.gfs.{init?fmt=%Y%m%d%H}', + r'pgbf.*\.gfs\.{init?fmt=%Y%m%d%H}'), + ] +) +@pytest.mark.util +def test_template_to_regex(template, expected_output): + assert template_to_regex(template) == expected_output @pytest.mark.parametrize( 'subset_definition, expected_result', [ diff --git a/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py b/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py index 1ef38667f1..de609612ab 100644 --- a/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py +++ b/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py @@ -198,7 +198,7 @@ def test_valid_init_env_vars(metplus_config, config_overrides, runtime_settings_dict_list = wrapper._get_all_runtime_settings(time_input) assert runtime_settings_dict_list - first_runtime_only = [runtime_settings_dict_list[0]] + first_runtime_only = runtime_settings_dict_list[0] wrapper._run_stat_analysis_job(first_runtime_only) all_cmds = wrapper.all_commands diff --git a/metplus/util/config_metplus.py b/metplus/util/config_metplus.py index 988472d630..f90aeed939 100644 --- a/metplus/util/config_metplus.py +++ b/metplus/util/config_metplus.py @@ -160,7 +160,7 @@ def _parse_launch_args(args): bad = False for arg in args: m = re.match(r'''(?x) - (?P
[a-zA-Z][a-zA-Z0-9_]*) + (?P
[a-zA-Z]\w*) \.(?P