I had marked a test as skip with the skip decorator available in Pytest refer: https://docs.pytest.org/en/stable/how-to/skipping.html#skipping-test-functions
# test_example.py
import pytest
# Test currently broken
@pytest.mark.skip(reason="Bug: Failing due to config changes")
def test_some_random_feature():
# ...
pass
While running the above snippet example with CTest:
I am observing the test as being passed with CTest:
Start 1: test_example.test_some_random_feature
1/1 Test #1: test_example.test_some_random_feature ...................... Passed 0.11 sec
Adding the following PROPERTY in pytest_discover_tests seems to be handling it:
pytest_discover_tests(
test_example
DEPENDS test_example.py
PROPERTIES
SKIP_REGULAR_EXPRESSION "SKIPP;skipp"
)
Output:
Start 1: test_example.test_some_random_feature
1/1 Test #1: test_example.test_some_random_feature ......................***Skipped 0.12 sec
A documentation/unit-test update would help with this feature tracking.