Skip to content

Commit

Permalink
HYDRA-289 : Move mayaUsd plugin check for tests into mtohUtils (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
debloip-adsk authored and GitHub Enterprise committed Jul 18, 2023
1 parent 919a705 commit c1f2bfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 1 addition & 9 deletions test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@
import unittest
import sys

def checkForMayaUsd():
try:
cmds.loadPlugin('mayaUsdPlugin')
except:
return False

return True

class TestStage(mtohUtils.MayaHydraBaseTestCase):
# MayaHydraBaseTestCase.setUpClass requirement.
_file = __file__

@unittest.skipUnless(checkForMayaUsd(), "Requires Maya USD Plugin.")
@unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.")
def test_addPrim(self):
import mayaUsd_createStageWithNewLayer
import mayaUsd.lib
Expand Down
8 changes: 8 additions & 0 deletions test/testUtils/mtohUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
HD_STORM = "HdStormRendererPlugin"
HD_STORM_OVERRIDE = "mayaHydraRenderOverride_" + HD_STORM

def checkForMayaUsdPlugin():
try:
cmds.loadPlugin('mayaUsdPlugin')
except:
return False

return True

class MayaHydraBaseTestCase(unittest.TestCase):
'''Base class for mayaHydra unit tests without image comparison.'''

Expand Down

0 comments on commit c1f2bfe

Please sign in to comment.