mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #5734 from tokejepsen/enhancement/testing_maya_usersetup
This commit is contained in:
commit
8fa342398a
2 changed files with 36 additions and 8 deletions
28
tests/integration/hosts/maya/input/startup/userSetup.py
Normal file
28
tests/integration/hosts/maya/input/startup/userSetup.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import logging
|
||||
import sys
|
||||
|
||||
from maya import cmds
|
||||
|
||||
import pyblish.util
|
||||
|
||||
|
||||
def setup_pyblish_logging():
|
||||
log = logging.getLogger("pyblish")
|
||||
handler = logging.StreamHandler(sys.stdout)
|
||||
formatter = logging.Formatter(
|
||||
"pyblish (%(levelname)s) (line: %(lineno)d) %(name)s:"
|
||||
"\n%(message)s"
|
||||
)
|
||||
handler.setFormatter(formatter)
|
||||
log.addHandler(handler)
|
||||
|
||||
|
||||
def _run_publish_test_deferred():
|
||||
try:
|
||||
setup_pyblish_logging()
|
||||
pyblish.util.publish()
|
||||
finally:
|
||||
cmds.quit(force=True)
|
||||
|
||||
|
||||
cmds.evalDeferred("_run_publish_test_deferred()", lowestPriority=True)
|
||||
|
|
@ -33,16 +33,16 @@ class MayaHostFixtures(HostFixtures):
|
|||
yield dest_path
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def startup_scripts(self, monkeypatch_session, download_test_data):
|
||||
def startup_scripts(self, monkeypatch_session):
|
||||
"""Points Maya to userSetup file from input data"""
|
||||
startup_path = os.path.join(download_test_data,
|
||||
"input",
|
||||
"startup")
|
||||
startup_path = os.path.join(
|
||||
os.path.dirname(__file__), "input", "startup"
|
||||
)
|
||||
original_pythonpath = os.environ.get("PYTHONPATH")
|
||||
monkeypatch_session.setenv("PYTHONPATH",
|
||||
"{}{}{}".format(startup_path,
|
||||
os.pathsep,
|
||||
original_pythonpath))
|
||||
monkeypatch_session.setenv(
|
||||
"PYTHONPATH",
|
||||
"{}{}{}".format(startup_path, os.pathsep, original_pythonpath)
|
||||
)
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def skip_compare_folders(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue