Skip to content

Commit 9d29b82

Browse files
authored
Fix test for Windows Canary build (#1264)
1 parent 5d0715e commit 9d29b82

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

tests/test_briefcase.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import tomli as tomllib
99

1010
import pytest
11+
from PIL import Image
1112

1213
from constructor.briefcase import (
1314
Payload,
@@ -1039,16 +1040,15 @@ def test_payload_pyproject_toml_installer_images(tmp_path, has_user_images):
10391040
info = mock_info.copy()
10401041

10411042
if has_user_images:
1042-
# Use existing test image from examples directory
1043-
repo_root = Path(__file__).parent.parent
1044-
example_image = (
1045-
repo_root / "examples" / "customized_welcome_conclusion" / "ExtraPagesExampleImg.bmp"
1046-
)
1047-
assert example_image.exists(), f"Test image not found: {example_image}"
1048-
1049-
info["welcome_image"] = str(example_image)
1050-
info["header_image"] = str(example_image)
1051-
info["icon_image"] = str(example_image)
1043+
# Create a minimal test image. We avoid using files from examples/ because canary
1044+
# builds run tests in an isolated conda-build environment where only the directories
1045+
# listed in recipe/meta.yaml's source_files are available.
1046+
test_image = tmp_path / "test_image.bmp"
1047+
Image.new("RGB", (10, 10), color="red").save(test_image)
1048+
1049+
info["welcome_image"] = str(test_image)
1050+
info["header_image"] = str(test_image)
1051+
info["icon_image"] = str(test_image)
10521052

10531053
payload = Payload(info)
10541054
payload.prepare()

0 commit comments

Comments
 (0)