From b3a5befeb0d5d9e348b1ba7b29f412b15544a0ec Mon Sep 17 00:00:00 2001 From: "Lovett, Trevor" Date: Wed, 16 Oct 2019 16:34:17 -0500 Subject: [VVP] Allow any_of and all_of in categories decorator Change-Id: I76ff9ebd7108d2ef19a3f167c5a253a3ce5f07f7 Issue-ID: VVP-331 Signed-off-by: Lovett, Trevor --- ice_validator/tests/conftest.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ice_validator/tests/conftest.py b/ice_validator/tests/conftest.py index 2a1cc55..3ef7fe1 100644 --- a/ice_validator/tests/conftest.py +++ b/ice_validator/tests/conftest.py @@ -360,13 +360,9 @@ def pytest_collection_modifyitems(session, config, items): config.traceability_items = list(items) # save all items for traceability if not config.option.self_test: for item in items: + passed_categories = set(config.option.test_categories or []) all_of_categories = getattr(item.function, "all_categories", set()) any_of_categories = getattr(item.function, "any_categories", set()) - if any_of_categories and all_of_categories: - raise RuntimeError( - "categories can not use 'any_of' with other categories" - ) - passed_categories = set(config.option.test_categories or []) if all_of_categories and not all_of_categories.issubset(passed_categories): item.add_marker( pytest.mark.skip( @@ -375,7 +371,7 @@ def pytest_collection_modifyitems(session, config, items): ) ) ) - elif any_of_categories and not passed_categories.intersection( + if any_of_categories and not passed_categories.intersection( any_of_categories ): item.add_marker( -- cgit 1.2.3-korg