From eda5ff6b91b48bec5e747754cc9f664e7e47c3a8 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 6 Dec 2021 17:28:02 +0100 Subject: [PATCH] OP-2042 - better format of asserts --- .../hosts/nuke/test_publish_in_nuke.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/integration/hosts/nuke/test_publish_in_nuke.py b/tests/integration/hosts/nuke/test_publish_in_nuke.py index fe1745299d..d603b9f177 100644 --- a/tests/integration/hosts/nuke/test_publish_in_nuke.py +++ b/tests/integration/hosts/nuke/test_publish_in_nuke.py @@ -24,7 +24,7 @@ class TestPublishInNuke(PublishTest): {OPENPYPE_ROOT}/.venv/Scripts/python.exe {OPENPYPE_ROOT}/start.py runtests ../tests/integration/hosts/nuke # noqa: E501 """ - PERSIST = False # True - keep test_db, test_openpype, outputted test files + PERSIST = True # True - keep test_db, test_openpype, outputted test files TEST_FILES = [ ("1SUurHj2aiQ21ZIMJfGVBI2KjR8kIjBGI", "test_Nuke_publish.zip", "") @@ -67,8 +67,10 @@ class TestPublishInNuke(PublishTest): def test_db_asserts(self, dbcon, publish_finished): """Host and input data dependent expected results in DB.""" print("test_db_asserts") - assert 5 == dbcon.count_documents({"type": "version"}), \ - "Not expected no of versions" + versions = dbcon.count_documents({"type": "version"}) + assert 5 == versions, \ + "Not expected no of versions. "\ + "Expected 5, found {}".format(versions) assert 0 == dbcon.count_documents({"type": "version", "name": {"$ne": 1}}), \ @@ -86,10 +88,12 @@ class TestPublishInNuke(PublishTest): assert 10 == dbcon.count_documents({"type": "representation"}), \ "Not expected no of representations" - assert 1 == dbcon.count_documents({"type": "representation", + reprs = dbcon.count_documents({"type": "representation", "context.subset": "renderCompositingInNukeMain", # noqa: E501 - "context.ext": "exr"}), \ - "Not expected no of representations with ext 'exr'" + "context.ext": "exr"}) + assert 1 == reprs, \ + "Not expected no of representations with ext 'exr'."\ + "Expected 1, found {}".format(reprs) if __name__ == "__main__":