-
Notifications
You must be signed in to change notification settings - Fork 13
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
Pytest 8 error: FixtureManager.getfixtureclosure() missing 1 required positional argument: 'ignore_args' #107
Comments
Oh good, another pytest major release, another set of breakage. If they could actually make stable APIs tools like Sybil could use, this wouldn't happen. For now, I'm just going to pin to "less than 8" |
pytest-dev/pytest#11868 (comment)
@cjw296 you can just change the call to |
|
That will not work. This is because the order of arguments changed between Pytest 7 and Pytest 8: def getfixtureclosure(
self,
fixturenames: Tuple[str, ...],
parentnode: nodes.Node,
ignore_args: Sequence[str] = (), changed to: def getfixtureclosure(
self,
parentnode: nodes.Node,
initialnames: Tuple[str, ...],
ignore_args: AbstractSet[str], For this particular error, I think that the best solution is: if PYTEST_VERSION >= (8, 0, 0):
closure = fm.getfixtureclosure(initialnames=names, parentnode=self, ignore_args=set())
else:
closure = fm.getfixtureclosure(parentnode=self, initialnames=names) I changed to keyword arguments for clarity and hopefully more stability. That said, once this particular error is fixed, more show up. |
@adamtheturtle - when pytest continually break APIs that plugins depend on, users of pytest have to deal with it as well as plugin authors. If you see the upstream issue report around this, a bunch of other plugins were also affected. Use of Sybil does not have a dependency on pytest, and Python's dependency specifications have no ways of expressing "requires version X of package A, but only if package A is in use", unless you know different? |
This is fixed in 6.0.3 which is now on pypi: https://pypi.org/project/sybil/6.0.3/ |
Thank you very much <3 |
@cjw296 I appreciate that
As a user of Sybil who does use Pytest, I would prefer to have You have a better understanding of the desire to not have an "unnecessary" dependency than I do, but from what I understand, my opinion is that having Pytest as a dependency of Sybil (maybe in a |
coming across this later and just wanna say the frustration is heard and i want to thank you for maintaining this tool <3 |
But what would that pin pytest to? These breakages have occurred on just about every type of pytest release from major down to third point? Chasing that is going to likely be as much work as just getting out a "fix" release for Sybil as soon as possible :-/ |
That's a shame! I'd suggest pinning to the latest major version, and that would decrease the number of times that this hits users. |
Can you provide evidence to support your claim? Especially since it directly contradicts my previous statement that, anecdotally, I've seen breakage on every type of release... |
@cjw296 I believe it would have avoided the issues which arose when Pytest bumped to 8.0.0. It wouldn't have avoided the issues on minor version changes. |
Pytest 8 was just released and it seems that this breaks sybil:
Found nothing related in the Changelogs and did not have time to dig deeper into it.
Maybe I can provide a fix later this day. :-)
The text was updated successfully, but these errors were encountered: