From 9d6325262422af907da41a0ede66d00371569bdc Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Mon, 30 Sep 2024 17:02:02 +0200 Subject: [PATCH] Make regex matching work with longer file names (#376) --- test/test_EDM4hepFile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_EDM4hepFile.py b/test/test_EDM4hepFile.py index a4f31c44e..461d1ee99 100644 --- a/test/test_EDM4hepFile.py +++ b/test/test_EDM4hepFile.py @@ -41,7 +41,7 @@ def inputfile_name(pytestconfig): @pytest.fixture(scope="module") def expected_edm4hep_version(inputfile_name): """Get the expected edm4hep version from the file name""" - rgx_match = re.match(VERSIONED_FILE_RGX, inputfile_name) + rgx_match = re.search(VERSIONED_FILE_RGX, inputfile_name) if not rgx_match: return podio.version.parse(__version__) return podio.version.parse(rgx_match.group(1).replace("-", ".")) @@ -50,7 +50,7 @@ def expected_edm4hep_version(inputfile_name): @pytest.fixture(scope="module") def expected_podio_version(inputfile_name): """Get the expected edm4hep version from the file name""" - rgx_match = re.match(VERSIONED_FILE_RGX, inputfile_name) + rgx_match = re.search(VERSIONED_FILE_RGX, inputfile_name) if not rgx_match: return podio.version.build_version return podio.version.parse(rgx_match.group(2).replace("-", "."))