-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 3.3: fixture-related breakage #2979
Comments
Just confirmed that problem is not there in 3.2.5. I suspect the following code may be in play: https://github.com/cjw296/sybil/blob/master/sybil/integration/pytest.py#L41 |
Initial attempt to fix pytest-dev/pytest#2979
Thanks @cjw296! The problem was introduced by fixing #2127: to obtain the correct "hook proxy" to call Lines 787 to 791 in 88ed1ab
Previously it would always access the global hook (skipping trying to access Lines 788 to 792 in a220a40
The problem is that I opened simplistix/sybil#5 with a quick fix for this. This demonstrates how hard is to extend the pytest internals because we don't have clear interfaces and documentation to what's needed to extend the internal classes properly. Having said that, it seems harsh that we have an Lines 548 to 557 in 88ed1ab
Perhaps it would be better to raise an exception explaining the problem? Also, it seems to me that this code: hook = self._fixturemanager.session.gethookproxy(request.node.fspath)
return hook.pytest_fixture_setup(fixturedef=self, request=request) Should use
Shouldn't |
This reverts commit ec1572d.
@nicoddemus fspath is always the owning functions fspath, node is the scope belonging node thats underlying the thing so the api is pretty much completely broken and unfixable without a major release that will nonetheless break peoples necks |
an additional note - the assertion sits there correctly, it could be enhanced with more debugging, but it certainly shouldnt be removed |
@RonnyPfannschmidt - what's the "owning function" here? SybilItem's are parts of It certainly makes me sad to have to copy'n'paste bits of pytest to get fixtures to work. |
@cjw296 frim pytest pov the sybil item is the "owning function" but there is not Sybil "File/Module" around to get the details to work i'm well aware that the fixture system is more like a bowl of pasta than a building block, but that kinda re-factoring is quite a undertaking |
Er, thanks github, but I think the PyTest guys weren't done discussing this ;-) |
@nicoddemus - thanks for the quick fix, feel free to close this issue unless you guys have further use for it. |
This reverts commit e8986d3.
Thanks @RonnyPfannschmidt, I think I understand, but would you mind provide a simple example? |
First spotted here:
https://travis-ci.org/Simplistix/testfixtures/builds/308659341?utm_source=email&utm_medium=notification
Confirmed as sybil, a pytest plugin, problem here:
https://travis-ci.org/cjw296/sybil/builds/308116822?utm_source=email&utm_medium=notification
Here's a short failure:
The text was updated successfully, but these errors were encountered: