Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit 6f19d5c

Browse files
fix test data loader
1 parent 133af27 commit 6f19d5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/shared.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030

3131
def load_test_data():
3232
"""Load data out of /data folder so we can use it in our tests"""
33+
prefix = f"{os.getcwd()}/tests/data"
3334
out = {}
34-
for fn in os.listdir(f"{os.getcwd()}/data"):
35+
for fn in os.listdir(prefix):
3536
key = fn.split('.')[0]
3637
if fn.endswith('.json'):
37-
with open(f'{os.getcwd()}/data/{fn}') as f:
38+
with open(f'{prefix}/{fn}') as f:
3839
out[key] = json.load(f)
3940
if fn.endswith('.txt'):
40-
with open(f'{os.getcwd()}/data/{fn}') as f:
41+
with open(f'{prefix}/{fn}') as f:
4142
out[key] = f.read()
4243
return out
4344

0 commit comments

Comments
 (0)