theY4Kman / pytest-only

pytest plug-in to run single tests with the "only" mark (perfect for use with auto-rerunners!)
https://pypi.org/project/pytest-only/
MIT License
18 stars 5 forks source link

FIX: use get_closest_marker where available, for 4.1.0 compat #7

Closed theY4Kman closed 5 years ago

theY4Kman commented 5 years ago

pytest 4.1.0 removed the get_marker method. To support older versions and 4.1.0, this PR uses either Node.get_closest_marker or Node.get_marker, with selection by feature detection.

Shoutout to @rib3 and @madzim for the johnny-on-the-spot PRs, which were how I found out about the removals. So much for semver :P

theY4Kman commented 5 years ago

Whoops, I'm totally presuming an item's class will always be Node, lemme fix that guy up. And lemme see if I can't knock down the pytest minimum version req.

theY4Kman commented 5 years ago

Well, that was an adventure. I chose pytest 2.6 as the earliest supported version.

More versions may be supported, but a distutils/distribute SSLError prevents installing <2.4, and assertion rewriting fails w/ py36+ and pytest<2.6