Skip to content

Commit fb826d1

Browse files
committed
fix: attempting old fashioned path walk
1 parent 8b2e100 commit fb826d1

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tests/tests.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ def test_simple_workflow(self, tmp_path):
4646
pattern = re.compile(r"efficiency_report_[\w-]+\.csv")
4747
report_found = False
4848

49-
for fname in os.listdir():
50-
if pattern.match(fname):
51-
report_found = True
52-
report_path = tmp_path / fname
53-
# Verify it's not empty
54-
assert (
55-
report_path.stat().st_size > 0
56-
), f"Efficiency report {report_path} is empty"
57-
break
49+
# as the directory is unclear, we need a path walk:
50+
for root, dirs, files in os.walk("/tmp/pytest-of-runner/"):
51+
for fname in files:
52+
if pattern.match(fname):
53+
report_found = True
54+
report_path = os.path.join(root, fname)
55+
# Verify it's not empty
56+
assert (
57+
os.stat(report_path).st_size > 0
58+
), f"Efficiency report {report_path} is empty"
59+
break
5860
assert report_found, "Efficiency report file not found"
5961

6062

0 commit comments

Comments
 (0)