Issues with PytestDeprecationWarning on direct construction of pytest.File/Item #7696
Labels
topic: collection
related to the collection phase
type: docs
documentation improvement, missing or needing clarification
type: question
general question, might be closed after 2 weeks of inactivity
Hi. We have implemented a pytest collector quite some time ago that gets testcases from YAML files. I have noticed the following deprecation warnings recently:
The source code for the collection is here: https://github.com/pywbem/pywbem/blob/master/tests/functiontest/conftest.py#L225
I have the following issues with that:
The
pytest.File
class is missing completely from the pytest API Reference docs.The
pytest.Item
class does not list afrom_parent()
method in the pytest API Reference docs for Item.For our
YamlFile
, I was able to map the arguments from the ctor to thefrom_parent()
method, but for ourYamlItem
it turns out we are passing the YAML file name as an additional argument to theYamlItem
ctor (for better error reporting), and I did not find a way to specify that via thefrom_parent()
method. Is there some way for theYamlItem
object to get at the file name of the YAML file? If not, could you possibly allow for additional kwargs that are passed on?Versions:
We have pinned pytest to <6.0.0 due to issue #7591 which was fixed meanwhile (thanks for that!!) but not yet released. After realizing that, I retested with pytest 6.0.1 and the same warnings were issued.
The text was updated successfully, but these errors were encountered: