--- a/Tests/test_file_webp.py
+++ b/Tests/test_file_webp.py
@@ -2,6 +2,8 @@ from PIL import Image, WebPImagePlugin
 
 from .helper import PillowTestCase, hopper, unittest
 
+import os
+
 try:
     from PIL import _webp
 
@@ -49,8 +51,12 @@ class TestFileWebp(PillowTestCase):
 
         # generated with:
         # dwebp -ppm ../../Tests/images/hopper.webp -o hopper_webp_bits.ppm
+        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'
         self.assert_image_similar_tofile(
-            image, "Tests/images/hopper_webp_bits.ppm", 1.0
+            image, target_file, 1.0)
         )
 
     def test_write_rgb(self):
