OP-3426 - refactor - Nuke to new testing classes

This commit is contained in:
Petr Kalis 2022-10-17 14:11:54 +02:00
parent a45218d48a
commit 6f5c91c785
2 changed files with 20 additions and 7 deletions

View file

@ -2,10 +2,14 @@ import os
import pytest
import shutil
from tests.lib.testing_classes import HostFixtures
from tests.lib.testing_classes import (
HostFixtures,
PublishTest,
DeadlinePublishTest
)
class NukeTestClass(HostFixtures):
class NukeHostFixtures(HostFixtures):
@pytest.fixture(scope="module")
def last_workfile_path(self, download_test_data, output_folder_url):
"""Get last_workfile_path from source data.
@ -41,4 +45,12 @@ class NukeTestClass(HostFixtures):
monkeypatch_session.setenv("NUKE_PATH",
"{}{}{}".format(startup_path,
os.pathsep,
original_nuke_path))
original_nuke_path))
class NukeLocalPublishTestClass(NukeHostFixtures, PublishTest):
"""Testing class for local publishes."""
class NukeDeadlinePublishTestClass(NukeHostFixtures, DeadlinePublishTest):
"""Testing class for Deadline publishes."""

View file

@ -1,12 +1,12 @@
import logging
from tests.lib.assert_classes import DBAssert
from tests.integration.hosts.nuke.lib import NukeTestClass
from tests.integration.hosts.nuke.lib import NukeLocalPublishTestClass
log = logging.getLogger("test_publish_in_nuke")
class TestPublishInNuke(NukeTestClass):
class TestPublishInNuke(NukeLocalPublishTestClass):
"""Basic test case for publishing in Nuke
Uses generic TestCase to prepare fixtures for test data, testing DBs,
@ -20,7 +20,8 @@ class TestPublishInNuke(NukeTestClass):
How to run:
(in cmd with activated {OPENPYPE_ROOT}/.venv)
{OPENPYPE_ROOT}/.venv/Scripts/python.exe {OPENPYPE_ROOT}/start.py runtests ../tests/integration/hosts/nuke # noqa: E501
{OPENPYPE_ROOT}/.venv/Scripts/python.exe {OPENPYPE_ROOT}/start.py
runtests ../tests/integration/hosts/nuke # noqa: E501
To check log/errors from launched app's publish process keep PERSIST
to True and check `test_openpype.logs` collection.
@ -37,7 +38,7 @@ class TestPublishInNuke(NukeTestClass):
# could be overwritten by command line arguments
# keep empty to locate latest installed variant or explicit
APP_VARIANT = ""
PERSIST = True # True - keep test_db, test_openpype, outputted test files
PERSIST = False # True - keep test_db, test_openpype, outputted test files
TEST_DATA_FOLDER = None
def test_db_asserts(self, dbcon, publish_finished):