Skip to content

Commit

Permalink
Attempt fix for macOS image comparison failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppt-adsk committed Nov 15, 2024
1 parent e76a52c commit eab3662
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions test/lib/mayaUsd/render/mayaToHydra/testBasicRender.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@

from string import digits

class TestSnapshot(mtohUtils.MayaHydraBaseTestCase):
class BasicRenderBaseTestCase(mtohUtils.MayaHydraBaseTestCase):

IMAGE_DIFF_FAIL_THRESHOLD = 0.01
IMAGE_DIFF_FAIL_PERCENT = 0.2

class TestSnapshot(BasicRenderBaseTestCase):
"""Tests whether our snapshot rendering works with basic Viewport 2.0"""

_file = __file__
Expand Down Expand Up @@ -51,16 +56,16 @@ def test_flat_orange(self):
cmds.setAttr('persp.rotate', 0, 0, 0, type='float3')
cmds.setAttr('persp.translate', 0, .25, .7, type='float3')

self.assertSnapshotEqual("flat_orange.png")
self.assertRaises(AssertionError,
self.assertSnapshotEqual, "flat_orange_bad.png")
self.assertSnapshotClose(
"flat_orange.png", self.IMAGE_DIFF_FAIL_THRESHOLD,
self.IMAGE_DIFF_FAIL_PERCENT)
self.assertRaises(
AssertionError, self.assertSnapshotClose, "flat_orange_bad.png",
self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

class TestMayaHydraRender(mtohUtils.MayaHydraBaseTestCase):
class TestMayaHydraRender(BasicRenderBaseTestCase):
_file = __file__

IMAGE_DIFF_FAIL_THRESHOLD = 0.01
IMAGE_DIFF_FAIL_PERCENT = 0.2

def test_cube(self):
imageVersion = maya.mel.eval("defaultShaderName").rstrip(digits)

Expand Down

0 comments on commit eab3662

Please sign in to comment.