From 21d882f3307deb3b357f4ee8f087294fbc78421c Mon Sep 17 00:00:00 2001 From: Till Hartmann Date: Mon, 9 Dec 2024 10:45:32 +0100 Subject: [PATCH] chore: use pydantic short version in tests (#569) --- .../workflows/test_workflows_variant_export_external.py | 4 +++- .../workflows/test_workflows_wgs_cnv_export_external.py | 4 +++- .../workflows/test_workflows_wgs_sv_export_external.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/snappy_pipeline/workflows/test_workflows_variant_export_external.py b/tests/snappy_pipeline/workflows/test_workflows_variant_export_external.py index d585cde7c..79e1045dc 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_variant_export_external.py +++ b/tests/snappy_pipeline/workflows/test_workflows_variant_export_external.py @@ -214,13 +214,15 @@ def test_workflow_check_config_invalid_search_pattern( # so pydantic tries to parse *2* dicts from the list and fails assert len(errors) == 2 + import pydantic + pydantic_version = pydantic.version.version_short() expected_errors = [ { "input": input_str, "loc": ("step_config", "variant_export_external", "search_patterns", i), "msg": "Input should be a valid dictionary", "type": "dict_type", - "url": "https://errors.pydantic.dev/2.7/v/dict_type", + "url": f"https://errors.pydantic.dev/{pydantic_version}/v/dict_type", } for i, input_str in enumerate(["vcf", "*/*.vcf.gz"]) ] diff --git a/tests/snappy_pipeline/workflows/test_workflows_wgs_cnv_export_external.py b/tests/snappy_pipeline/workflows/test_workflows_wgs_cnv_export_external.py index 1f28ad1f1..22a47547f 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_wgs_cnv_export_external.py +++ b/tests/snappy_pipeline/workflows/test_workflows_wgs_cnv_export_external.py @@ -213,13 +213,15 @@ def test_workflow_check_config_invalid_search_pattern( # so pydantic tries to parse *2* dicts from the list and fails assert len(errors) == 2 + import pydantic + pydantic_version = pydantic.version.version_short() expected_errors = [ { "input": input_str, "loc": ("step_config", "wgs_cnv_export_external", "search_patterns", i), "msg": "Input should be a valid dictionary", "type": "dict_type", - "url": "https://errors.pydantic.dev/2.7/v/dict_type", + "url": f"https://errors.pydantic.dev/{pydantic_version}/v/dict_type", } for i, input_str in enumerate(["vcf", "*/*.vcf.gz"]) ] diff --git a/tests/snappy_pipeline/workflows/test_workflows_wgs_sv_export_external.py b/tests/snappy_pipeline/workflows/test_workflows_wgs_sv_export_external.py index 6a13c3ff0..f5cf79392 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_wgs_sv_export_external.py +++ b/tests/snappy_pipeline/workflows/test_workflows_wgs_sv_export_external.py @@ -213,13 +213,15 @@ def test_workflow_check_config_invalid_search_pattern( # so pydantic tries to parse *2* dicts from the list and fails assert len(errors) == 2 + import pydantic + pydantic_version = pydantic.version.version_short() expected_errors = [ { "input": input_str, "loc": ("step_config", "wgs_sv_export_external", "search_patterns", i), "msg": "Input should be a valid dictionary", "type": "dict_type", - "url": "https://errors.pydantic.dev/2.7/v/dict_type", + "url": f"https://errors.pydantic.dev/{pydantic_version}/v/dict_type", } for i, input_str in enumerate(["vcf", "*/*.vcf.gz"]) ]