Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Updated test suite to remove use of generators as co-routines. #102

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/78.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support for using a generator as a co-routine has been removed, in line with the change in behavior in Python 3.12. Python 3.11 and earlier will still support this usage, but it is no longer verified as part of GBulb.
11 changes: 5 additions & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ class TestObject(GObject.GObject):

t = TestObject()

def emitter():
yield
async def emitter():
t.emit("foo", "frozen brains tell no tales")

called = False
Expand Down Expand Up @@ -115,16 +114,16 @@ class TestObject(GObject.GObject):

t = TestObject()

def emitter():
yield
async def emitter():
t.emit("foo", "frozen brains tell no tales")

called = False
cancelled = False

def waiter():
async def waiter():
nonlocal cancelled
yield
# Yield to the event loop
await asyncio.sleep(0)

r = wait_signal(t, "foo")

Expand Down