Skip to content

Commit

Permalink
Make regex matching work with longer file names
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 30, 2024
1 parent eb8592e commit c79f026
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_EDM4hepFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("-", "."))
Expand All @@ -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("-", "."))
Expand Down

0 comments on commit c79f026

Please sign in to comment.