Pytest: Remove deprecated Node.get_marker

Created on 14 Dec 2018  路  9Comments  路  Source: pytest-dev/pytest

@RonnyPfannschmidt are you OK with removing this directly or would you like to change this into an error or something?

removal

Most helpful comment

FWIW this change breaks a lot of CI stuff apparently without notice probably due to the way the deprecation was handled. Would be nice if the changelog contained a link on how to do it correctly as this would save a lot of us some time! :-)

All 9 comments

@nicoddemus the return value practically errors already, there just is the edge-case that the non-return case didnt warn/error (its just in the docstring)

so i think killing it is ok

this is part of #891

FWIW this change breaks a lot of CI stuff apparently without notice probably due to the way the deprecation was handled. Would be nice if the changelog contained a link on how to do it correctly as this would save a lot of us some time! :-)

@Themanwithoutaplan definitely we should have handled that deprecation better, thanks for the feedback and sorry to hear you have wasted time on this.

We did add this to the CHANGELOG:

4546: Remove Node.get_marker(name) the return value was not usable for more than a existence check.

Use Node.get_closest_marker(name) as a replacement.

You feel we should have pointed to https://docs.pytest.org/en/latest/mark.html#update-marker-code directly instead?

@Themanwithoutaplan definitely we should have handled that deprecation better, thanks for the feedback and sorry to hear you have wasted time on this.
I just checked the changelog: there was no explicit deprecation of this so a deprecation warning should have been added at some point. If you look at the linked reports you'll see quite a few people have simply pinned to 4.0.0 so that they're not swamped with exceptions from CI.

I suspect some of us will have written markers years ago and not touched them since then so some extra handholding would be appreciated. It's a pain, but important stuff should always be deprecated with a warning before it's removed and then ideally in major releases.

The fix is fairly painless but I'm not sure I understand the justification or the new method name. Fortunately, I don't really have to.

@Themanwithoutaplan basically whatever get_marker returned was in any case incomplete and fundamentally broken

but yes, the deprecation could have been handled much better

@Themanwithoutaplan if you are interested on the rationale for the name change/mark revamp, please read this: https://docs.pytest.org/en/latest/mark.html#marker-revamp-and-iteration

We are happy to answer any questions you might have. 馃榿

@Themanwithoutaplan if you are interested on the rationale for the name change/mark revamp, please read this: https://docs.pytest.org/en/latest/mark.html#marker-revamp-and-iteration

We are happy to answer any questions you might have. 馃榿

Not really interested in a discussion to be honest, just want it work! :-D Thanks for updating the changelog with a note on how to fix it.

Was this page helpful?
0 / 5 - 0 ratings