Skip to content

Commit

Permalink
Merge branch 'main' into munir/refactor-decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Dec 9, 2024
2 parents 2a66d47 + 0ea89ef commit 53e7da1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ def _collect_item_metadata(item):
result["testDeclaration"] = "flaky"
elif result["details"].startswith("bug"):
result["testDeclaration"] = "bug"
elif result["details"].startswith("incomplete_test_app"):
result["testDeclaration"] = "incompleteTestApp"
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|incomplete_test_app)( \(.+\))?$", declaration):
return

# must be a version declaration or semver spec
Expand Down
3 changes: 2 additions & 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, incomplete_test_app
from utils import interfaces, _remote_config as remote_config
from utils.interfaces._core import ValidationError
from utils._features import features
Expand All @@ -17,6 +17,7 @@
"context",
"features",
"flaky",
"incomplete_test_app",
"interfaces",
"irrelevant",
"missing_feature",
Expand Down
14 changes: 7 additions & 7 deletions utils/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ def missing_feature(condition=None, library=None, weblog_variant=None, reason=No
return partial(decorator, skip, force_skip, condition, "missing_feature", reason, _get_expected_failure_item)


def incomplete_test_app(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)
noxfail = False
return partial(decorator, skip, noxfail, condition, "incomplete_test_app", reason, _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"""
skip = _should_skip(library=library, weblog_variant=weblog_variant, condition=condition)
Expand All @@ -138,13 +145,6 @@ def flaky(condition=None, library=None, weblog_variant=None, reason=None):
return partial(decorator, skip, noxfail, condition, "flaky", reason, _get_expected_failure_item)


def incomplete_test_app(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)
noxfail = False
return partial(decorator, skip, noxfail, condition, "incomplete_test_app", reason, _get_expected_failure_item)


def released(
cpp=None,
dotnet=None,
Expand Down

0 comments on commit 53e7da1

Please sign in to comment.