Skip to content

Commit 2cb9233

Browse files
committed
refactoring
1 parent 037ab29 commit 2cb9233

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tests/python_tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def download_test_content(request):
120120
# If the file is a tarball, extract it
121121
extracted_dir = None
122122
if file_name.endswith(".tar.gz"):
123-
extracted_dir = os.path.join(test_data, os.path.splitext(os.path.splitext(file_name)[0])[0])
123+
file_name_with_tar = os.path.splitext(file_name)[0] # Removes .gz
124+
file_name = os.path.splitext(file_name_with_tar)[0] # Removes .tar
125+
extracted_dir = os.path.join(test_data, file_name)
124126
if not os.path.exists(extracted_dir):
125127
os.makedirs(extracted_dir, exist_ok=True)
126128
shutil.unpack_archive(file_path, extracted_dir)

tests/python_tests/utils/milebench.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ def __len__(self):
3535

3636
@staticmethod
3737
def _transform_string(s: str) -> str:
38-
import re
39-
4038
counter = iter(range(1, s.count("{i}") + 1))
4139
return re.sub(r"\{i\}", lambda _: str(next(counter)), s)
4240

@@ -156,7 +154,6 @@ def process(self, answer):
156154
answer = answer.strip()
157155
answer = self.processPunctuation(answer)
158156
answer = answer.strip('"')
159-
answer = answer.strip('"')
160157
answer = answer.strip().lower()
161158
return answer
162159

0 commit comments

Comments
 (0)