Add properties to each test. List of tests
Is there a way to add custom property (for example LABELS or WORKING_DIRECTORY) to each of the tests, added by pytest_discover_tests?
Looks like my tests want to be launched in the specific directory + I want to separate long-running python from gtests of my project with a labels. The ability to hack-into and get the list of all tests might be really helpful, until every feature is supported natively with this function.
Thanks!
@pprettysimpple Apologies for the delayed response. Currently, you can set a WORKING_DIRECTORY or a custom ENVIRONMENT as an option (see API Reference), but custom properties are not available yet.
I'm working on it as part of this PR: https://github.com/python-cmake/pytest-cmake/pull/46
You should be able to add custom PROPERTIES as follows:
pytest_discover_tests(
PythonTest
...
PROPERTIES
TIMEOUT 120
LABELS "unit_tests;fast_tests"
)
Please let me know if this meets your requirements!
Custom properties were added as part of v0.11.0, so I'm closing this ticket for now. Please re-open it if needed.
thank you, I think it fits our use case. I will try it out in a few days