Open ushankax opened 2 months ago
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 conftest.py
:
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 pytest --exclude-manual
.
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: