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

Add in_trio_run and in_trio_task #3195

Merged
merged 7 commits into from
Jan 31, 2025
Merged

Conversation

A5rocks
Copy link
Contributor

@A5rocks A5rocks commented Jan 30, 2025

Fixes #2757

See the documentation and tests for the cases in which these two differ. Feel free to ask me to add more scenarios.

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00000%. Comparing base (d7cb2fc) to head (ce97b8a).
Report is 11 commits behind head on main.

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3195   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             124          124           
  Lines           18733        18792   +59     
  Branches         1265         1268    +3     
===============================================
+ Hits            18733        18792   +59     
Files with missing lines Coverage Δ
src/trio/_core/__init__.py 100.00000% <ø> (ø)
src/trio/_core/_run.py 100.00000% <100.00000%> (ø)
src/trio/_core/_tests/test_guest_mode.py 100.00000% <100.00000%> (ø)
src/trio/_core/_tests/test_instrumentation.py 100.00000% <100.00000%> (ø)
src/trio/_core/_tests/test_run.py 100.00000% <100.00000%> (ø)
src/trio/lowlevel.py 100.00000% <ø> (ø)

docs/source/reference-lowlevel.rst Outdated Show resolved Hide resolved
docs/source/reference-lowlevel.rst Outdated Show resolved Hide resolved
docs/source/reference-lowlevel.rst Outdated Show resolved Hide resolved
docs/source/reference-lowlevel.rst Outdated Show resolved Hide resolved
docs/source/reference-lowlevel.rst Outdated Show resolved Hide resolved
src/trio/_core/_run.py Outdated Show resolved Hide resolved
docs/source/reference-lowlevel.rst Outdated Show resolved Hide resolved
Copy link
Member

@oremanj oremanj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

docs/source/reference-lowlevel.rst Outdated Show resolved Hide resolved
Co-authored-by: Joshua Oreman <[email protected]>
@jakkdl jakkdl requested a review from Zac-HD January 30, 2025 08:57
Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @A5rocks!

@Zac-HD Zac-HD added this pull request to the merge queue Jan 31, 2025
Merged via the queue into python-trio:main with commit d39444a Jan 31, 2025
39 checks passed
@A5rocks A5rocks deleted the check-trio-running branch January 31, 2025 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an @trio.not_in_async_task decorator, to error instead of stalling
3 participants