Skip to content

Commit

Permalink
Replace all non alphanumeric characters with underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
KasukabeDefenceForce committed Dec 6, 2024
1 parent 61e6a8b commit 2dd00b4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tardis/tests/fixtures/regression_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ def test_name(self):

@property
def fname_prefix(self):
double_under = re.compile(r"[:\[\]{}]")
no_space = re.compile(r'[,"\']') # quotes and commas

name = double_under.sub("__", self.test_name)
name = no_space.sub("", name)
return name
name = re.sub(r"[^a-zA-Z0-9]+", "_", self.test_name)
sanitized_name = name.strip("_")
return sanitized_name

@property
def relative_regression_data_dir(self):
Expand Down

0 comments on commit 2dd00b4

Please sign in to comment.