Explorar el Código

Relax test image difference requirement.

tags/2.5.0
Matthew Petroff hace 5 años
padre
commit
6f33ab022a
Se han modificado 1 ficheros con 9 adiciones y 3 borrados
  1. +9
    -3
      tests/run_tests.py

+ 9
- 3
tests/run_tests.py Ver fichero

@@ -72,7 +72,9 @@ def run_tests():
else:
reference = Image.open("tests/equirectangular.png")
screenshot = Image.open(io.BytesIO(viewer.screenshot_as_png)).convert("RGB")
assert np.mean(np.array(ImageChops.difference(screenshot, reference))) < 1
diff = np.mean(np.array(ImageChops.difference(screenshot, reference)))
print("equirectangular difference:", diff)
assert diff < 10
print("PASS: equirectangular")

# Check movement
@@ -107,7 +109,9 @@ def run_tests():
else:
reference = Image.open("tests/cube.png")
screenshot = Image.open(io.BytesIO(viewer.screenshot_as_png)).convert("RGB")
assert np.mean(np.array(ImageChops.difference(screenshot, reference))) < 1
diff = np.mean(np.array(ImageChops.difference(screenshot, reference)))
print("cube difference:", diff)
assert diff < 10
print("PASS: cube")

# Check hot spot
@@ -123,7 +127,9 @@ def run_tests():
else:
reference = Image.open("tests/multires.png")
screenshot = Image.open(io.BytesIO(viewer.screenshot_as_png)).convert("RGB")
assert np.mean(np.array(ImageChops.difference(screenshot, reference))) < 1
diff = np.mean(np.array(ImageChops.difference(screenshot, reference)))
print("multires difference:", diff)
assert diff < 10
print("PASS: multires")




Cargando…
Cancelar
Guardar