Skip to content
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

Add compatibility against Pytest 5.4+ #408

Merged
merged 1 commit into from Sep 3, 2020

Conversation

stanislavlevin
Copy link
Contributor

The direct construction of nodes is deprecated since Pytest 5.4 [0]:

The construction of nodes now should use the named constructor
from_parent. This limitation in api surface intends to enable
better/simpler refactoring of the collection tree.
This means that instead of MyItem(name="foo", parent=collector, obj=42)
one now has to invoke MyItem.from_parent(collector, name="foo").

[0]: https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent

Fixes: #407

The direct construction of nodes is deprecated since Pytest 5.4 [0]:
> The construction of nodes now should use the named constructor
from_parent. This limitation in api surface intends to enable
better/simpler refactoring of the collection tree.
    This means that instead of MyItem(name="foo", parent=collector, obj=42)
one now has to invoke MyItem.from_parent(collector, name="foo").

[0]: https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent

Fixes: Kronuz#407
Signed-off-by: Stanislav Levin <slev@altlinux.org>
@coveralls
Copy link

coveralls commented Aug 5, 2020

Coverage Status

Coverage decreased (-0.04%) to 66.821% when pulling 5d88081 on stanislavlevin:fix_pytest6 into 36e8452 on Kronuz:master.

@e0ne e0ne merged commit ef3f998 into Kronuz:master Sep 3, 2020
@e0ne
Copy link
Collaborator

e0ne commented Sep 3, 2020

Thanks for the fix, @stanislavlevin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

self-tests fail against Pytest 6.0.1
3 participants