oremanj / greenback

Reenter an asyncio or Trio event loop from synchronous code
https://greenback.readthedocs.io/
Other
77 stars 2 forks source link

Fix contextvar leakage when one greenback-enabled task calls bestow_portal() for another #18

Closed oremanj closed 1 year ago

oremanj commented 1 year ago

Fixes #17. Verified that the new test fails without the code change here.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (b612744) 100.00% compared to head (40343ab) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #18 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 7 7 Lines 734 769 +35 Branches 109 112 +3 ========================================= + Hits 734 769 +35 ``` | Flag | Coverage Δ | | |---|---|---| | cpython | `99.21% <96.42%> (+0.03%)` | :arrow_up: | | pypy36release | `91.38% <66.07%> (-2.67%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joshua+Oreman#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/oremanj/greenback/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joshua+Oreman) | Coverage Δ | | |---|---|---| | [greenback/\_impl.py](https://codecov.io/gh/oremanj/greenback/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joshua+Oreman#diff-Z3JlZW5iYWNrL19pbXBsLnB5) | `100.00% <100.00%> (ø)` | | | [greenback/\_tests/test\_impl.py](https://codecov.io/gh/oremanj/greenback/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joshua+Oreman#diff-Z3JlZW5iYWNrL190ZXN0cy90ZXN0X2ltcGwucHk=) | `100.00% <100.00%> (ø)` | | | [greenback/\_util.py](https://codecov.io/gh/oremanj/greenback/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joshua+Oreman#diff-Z3JlZW5iYWNrL191dGlsLnB5) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joshua+Oreman). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joshua+Oreman)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.