Skip to content

Commit a871d84

Browse files
committed
Added test
1 parent d6c1f1d commit a871d84

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

trio/tests/test_threads.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,3 +576,10 @@ async def main():
576576

577577
_core.run(main)
578578
assert record == ["ok"]
579+
580+
581+
async def test_trio_token_weak_referenceable():
582+
token = current_trio_token()
583+
assert isinstance(token, TrioToken)
584+
weak_reference = weakref.ref(token)
585+
assert token is weak_reference()

0 commit comments

Comments
 (0)