Merge pull request #5734 from tokejepsen/enhancement/testing_maya_usersetup

This commit is contained in:
Ondřej Samohel 2023-10-17 12:55:53 +02:00 committed by GitHub
commit 8fa342398a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 8 deletions

View 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)

View file

@ -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):