File: generate-webp-file

package info (click to toggle)
pillow 12.0.0-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 72,636 kB
  • sloc: python: 49,518; ansic: 38,787; makefile: 302; sh: 168; javascript: 85
file content (24 lines) | stat: -rw-r--r-- 806 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- a/Tests/test_file_webp.py
+++ b/Tests/test_file_webp.py
@@ -19,6 +19,8 @@ from .helper import (
     skip_unless_feature,
 )
 
+import os
+
 try:
     from PIL import _webp
 
@@ -64,7 +66,11 @@ class TestFileWebp:
 
             # generated with:
             # dwebp -ppm ../../Tests/images/hopper.webp -o hopper_webp_bits.ppm
-            assert_image_similar_tofile(image, "Tests/images/hopper_webp_bits.ppm", 1.0)
+            if 'ADTTMP' in os.environ:
+                target_file = os.path.join(os.environ['ADTTMP'], 'hopper_webp.ppm')
+            else:
+                target_file = 'Tests/images/hopper_webp_bits.ppm'
+            assert_image_similar_tofile(image, target_file, 1.0)
 
     def _roundtrip(
         self, tmp_path: Path, mode: str, epsilon: float, args: dict[str, Any] = {}