Skip to content
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

[RFC] multicall: hookwrapper: use yielded results, support firstresult=True #246

Closed

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jan 12, 2020

Ref: pytest-dev/pytest#5301 (comment)

Currently results from a hookwrapper are ignored, this changes the behavior (see test_hookwrapper_order).
Should this be explicitly enabled, e.g. via a new "use_hookwrapper_result" kwarg for the hookwrapper? As the existing test shows "yield" might be used with a result, which currently is ignored.

A hookwrapper currently can set the return value / outcome via force_result, but it would still run non-hookwrappers before.

@codecov-io
Copy link

codecov-io commented Jan 12, 2020

Codecov Report

Merging #246 into master will decrease coverage by 0.7%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #246      +/-   ##
==========================================
- Coverage   92.91%   92.21%   -0.71%     
==========================================
  Files          14       14              
  Lines        1651     1541     -110     
  Branches      115      116       +1     
==========================================
- Hits         1534     1421     -113     
- Misses        101      102       +1     
- Partials       16       18       +2
Impacted Files Coverage Δ
src/pluggy/callers.py 79.36% <100%> (+0.16%) ⬆️
testing/test_multicall.py 99.23% <100%> (-0.05%) ⬇️
testing/test_hookcaller.py 77.39% <0%> (-4.81%) ⬇️
src/pluggy/manager.py 92.3% <0%> (-2.09%) ⬇️
testing/conftest.py 91.66% <0%> (-1.67%) ⬇️
testing/test_deprecations.py 90.62% <0%> (-0.56%) ⬇️
testing/test_helpers.py 81.48% <0%> (-0.34%) ⬇️
testing/test_pluginmanager.py 95.67% <0%> (-0.33%) ⬇️
testing/test_invocations.py 98.34% <0%> (-0.27%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a341b6...76838b1. Read the comment docs.

@RonnyPfannschmidt
Copy link
Member

this should get a new name as its a new flow control

hookdecorator sounds possibly sensible - we should also figure how they order relative to regular hook wrappers (as its potentially critical to be either before them or always within them)

@blueyed
Copy link
Contributor Author

blueyed commented Jan 13, 2020

Yeah, ok. Not planning to do this anytime soon - closing.

I've used two subplugins with pytest-dev/pytest#6448 now.

@blueyed blueyed closed this Jan 13, 2020
@blueyed blueyed deleted the multicall-hookwrapper-result branch January 13, 2020 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants