str0zzapreti / pytest-retry

A simple plugin for retrying flaky tests in CI environments
MIT License
27 stars 6 forks source link

fixed Item instantiation error in Pytest 8 #35

Closed str0zzapreti closed 5 months ago

str0zzapreti commented 5 months ago

Thanks to @adamtheturtle for highlighting this change and pushing an initial fix!

str0zzapreti commented 5 months ago

@adamtheturtle As far as I can tell this fix is functionally identical to the one you proposed in https://github.com/str0zzapreti/pytest-retry/pull/34. I experimented with a couple of other Item subclasses including Function and FunctionDefinition but settled on Class as the simplest way to resolve the error while ensuring the necessary fixture scopes are all handled correctly. I prefer this over using Module because it minimizes imports, but otherwise your fix is just as good (ignoring the added tests and comment updates).