Skip to content

Commit

Permalink
add test_inconsistency annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Nov 25, 2024
1 parent 2b4c3fc commit 6a62392
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def _collect_item_metadata(item):
result["testDeclaration"] = "flaky"
elif result["details"].startswith("bug"):
result["testDeclaration"] = "bug"
elif result["details"].startswith("test_inconsistency"):
result["testDeclaration"] = "testIncomplete"
elif result["details"].startswith("missing_feature"):
result["testDeclaration"] = "notImplemented"
elif "got empty parameter set" in result["details"]:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_the_test/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def assert_in(elements, module, nodeid):
def assert_valid_declaration(declaration):
assert isinstance(declaration, str)

if re.match(r"^(bug|flaky|irrelevant|missing_feature)( \(.+\))?$", declaration):
if re.match(r"^(bug|flaky|irrelevant|missing_feature|test_inconsistency)( \(.+\))?$", declaration):
return

# must be a version declaration or semver spec
Expand Down
2 changes: 1 addition & 1 deletion utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from utils._weblog import weblog
from utils._context.core import context
from utils._context._scenarios import scenarios
from utils._decorators import bug, irrelevant, missing_feature, rfc, flaky
from utils._decorators import bug, irrelevant, missing_feature, rfc, flaky, test_inconsistency
from utils import interfaces, _remote_config as remote_config
from utils.interfaces._core import ValidationError
from utils._features import features
7 changes: 7 additions & 0 deletions utils/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ def missing_feature(condition=None, library=None, weblog_variant=None, reason=No
return partial(decorator, skip, condition, "missing_feature", reason, False, _get_expected_failure_item)


def test_inconsistency(condition=None, library=None, weblog_variant=None, reason=None):
"""Decorator, allow to mark a test function/class as not compatible with the tested application"""

skip = _should_skip(library=library, weblog_variant=weblog_variant, condition=condition)
return partial(decorator, skip, condition, "test_inconsistency", reason, False, _get_expected_failure_item)


def irrelevant(condition=None, library=None, weblog_variant=None, reason=None):
"""decorator, allow to mark a test function/class as not relevant"""

Expand Down

0 comments on commit 6a62392

Please sign in to comment.