-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Excluding allure-labels in pytest run #812
Labels
Comments
delatrie
added
theme:pytest
task:new feature
Requesting new capability or software feature
labels
May 23, 2024
Hi, @ushankax. Thank you for the feature request. That's something that might be implemented in the future. Sorry for not giving any specific date. That said, it's much quicker to implement such specific filtering in your own code. Just put the following in your from allure_commons.types import LabelType
from allure_pytest.utils import allure_label
def pytest_addoption(parser):
parser.addoption('--exclude-manual', action='store_true')
def pytest_collection_modifyitems(config, items):
if config.getoption("--exclude-manual"):
items[:] = filter(
lambda item: not any(allure_label(item, LabelType.MANUAL)),
items,
) Then, exclude manual tests by invoking |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm submitting a ...
What is the current behavior?
We have CLI param
--allure-label
and its possible to INCLUDE labels. Like--allure-label method=AnyMethod
and it worksIf the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
But I decided to try to exclude from run tests with
@allure.manual(True)
decorator and came across a bunch of things:--allure-label ALLURE_MANUAL=True
in CLI so it will deselect everything.@allure.manual('True')
and set the same--allure-label ALLURE_MANUAL=True
in CLI -- it works and manual tests will be selected.What is the expected behavior?
I want not just include labels, but also exclude. Something like
--allure-label "not ALLURE_MANUAL=True"
What is the motivation / use case for changing the behavior?
We write tests as code and we dont need manual test cases in allure report. With this feature we will be able to run night tests and they will be closed automatically in allure testOps.
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: