OP-3426 - refactor - replaced check of env var with function

It would be better to modify single function if necessary.
This commit is contained in:
Petr Kalis 2022-11-07 11:40:15 +01:00
parent 058d4014a8
commit 66bea60bdd
15 changed files with 38 additions and 15 deletions

View file

@ -5,6 +5,8 @@ import shutil
import pyblish.api
import re
from openpype.tests.lib import is_in_tests
class CleanUp(pyblish.api.InstancePlugin):
"""Cleans up the staging directory after a successful publish.
@ -44,7 +46,7 @@ class CleanUp(pyblish.api.InstancePlugin):
def process(self, instance):
"""Plugin entry point."""
if os.environ.get("IS_TEST"):
if is_in_tests():
# let automatic test process clean up temporary data
return
# Get the errored instances

View file

@ -2,6 +2,7 @@ import os
import pyblish.api
from openpype.lib import get_version_from_path
from openpype.tests.lib import is_in_tests
class CollectSceneVersion(pyblish.api.ContextPlugin):
@ -36,7 +37,7 @@ class CollectSceneVersion(pyblish.api.ContextPlugin):
# tests should be close to regular publish as possible
if (
os.environ.get("HEADLESS_PUBLISH")
and not os.environ.get("IS_TEST")
and not is_in_tests()
and context.data["hostName"] in self.skip_hosts_headless_publish):
self.log.debug("Skipping for headless publishing")
return