forked from pool/python-promise
- Add python-311.patch to support python 3.11
gh#syrusakbary/promise#99 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-promise?expand=0&rev=11
This commit is contained in:
41
python-311.patch
Normal file
41
python-311.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
diff --git a/tests/test_awaitable.py b/tests/test_awaitable.py
|
||||
index aad7f2c..a14a181 100644
|
||||
--- a/tests/test_awaitable.py
|
||||
+++ b/tests/test_awaitable.py
|
||||
@@ -1,18 +1,15 @@
|
||||
-from asyncio import coroutine
|
||||
from pytest import mark
|
||||
from time import sleep
|
||||
from promise import Promise
|
||||
|
||||
|
||||
@mark.asyncio
|
||||
-@coroutine
|
||||
-def test_await():
|
||||
- yield from Promise.resolve(True)
|
||||
+async def test_await():
|
||||
+ await Promise.resolve(True)
|
||||
|
||||
|
||||
@mark.asyncio
|
||||
-@coroutine
|
||||
-def test_await_time():
|
||||
+async def test_await_time():
|
||||
def resolve_or_reject(resolve, reject):
|
||||
sleep(.1)
|
||||
resolve(True)
|
||||
@@ -22,11 +19,9 @@ def resolve_or_reject(resolve, reject):
|
||||
|
||||
|
||||
@mark.asyncio
|
||||
-@coroutine
|
||||
-def test_promise_coroutine():
|
||||
- @coroutine
|
||||
- def my_coro():
|
||||
- yield from Promise.resolve(True)
|
||||
+async def test_promise_coroutine():
|
||||
+ async def my_coro():
|
||||
+ await Promise.resolve(True)
|
||||
|
||||
promise = Promise.resolve(my_coro())
|
||||
assert isinstance(promise, Promise)
|
Reference in New Issue
Block a user