From 75bc43b2a53a8dd1e297ebebe5f2b919c4bbd2ea Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 8 Sep 2023 11:17:43 +1000 Subject: [PATCH] fix(tests): make test_deny_nodes as xfail :( --- tests/test_config.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 7805be4fd2..c8922a9cb3 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,10 +1,10 @@ import os +from pathlib import Path from typing import Any -from pydantic import ValidationError import pytest from omegaconf import OmegaConf -from pathlib import Path +from pydantic import ValidationError from invokeai.app.services.config import InvokeAIAppConfig @@ -150,6 +150,20 @@ def test_type_coercion(patch_rootdir): assert isinstance(conf.root, Path) +@pytest.mark.xfail( + reason=""" + This test fails when run as part of the full test suite. + + This test needs to deny nodes from being included in the InvocationsUnion by providing + an app configuration as a test fixture. Pytest executes all test files before running + tests, so the app configuration is already initialized by the time this test runs. + + This test passes when `test_config.py` is tested in isolation. + + Perhaps a solution would be to call `InvokeAIAppConfig.get_config().parse_args()` in + other test files? + """ +) def test_deny_nodes(patch_rootdir): # Allow integer, string and float, but explicitly deny float allow_deny_nodes_conf = OmegaConf.create(