Skip to content

Commit 2454367

Browse files
committed
Fixed failing test on py3.9 and macos15
1 parent 086623b commit 2454367

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/zim/test_fs.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
# vim: ai ts=4 sts=4 et sw=4 nu
33

4+
import pathlib
45
import shutil
56
import subprocess
67
import sys
@@ -147,7 +148,17 @@ def test_make_zim_file_no_file_on_error(tmp_path, png_image, build_data):
147148
print("Program exiting")
148149
"""
149150

150-
py = subprocess.run([sys.executable, "-c", pycode], check=False)
151+
py = subprocess.run(
152+
[sys.executable, "-c", pycode],
153+
check=False,
154+
# using python3.9 on macOS15, calling this failed to find zimscraperlib
155+
# making the subprocess exit with 1
156+
env=(
157+
{"PYTHONPATH": str(pathlib.Path.cwd() / "src")}
158+
if sys.version_info[:2] == (3, 9)
159+
else None
160+
),
161+
)
151162
# returncode will be either 0 or -11, depending on garbage collection
152163
# in scrapers, we want to be able to fail on errors and absolutely don't want to
153164
# create a ZIM file, so SEGFAULT on exit it (somewhat) OK

0 commit comments

Comments
 (0)