deasync-1.0.1
توضیحات
deasync decorator to make async functions/methods synchronous.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | deasync-1.0.1 |
| نام | deasync |
| نسخه کتابخانه | 1.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Stanislav Prokop |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/prokopst/deasync |
| آدرس اینترنتی | https://pypi.org/project/deasync/ |
| مجوز | MIT |
deasync provides a decorator called `deasync` for Python 3.5 (or higher) to make async functions synchronous in places where only synchronous functions are expected, for example in `unittest.TestCase`:
.. code:: python
from asyncio import sleep
from unittest import TestCase
from deasync import deasync
async def function42():
await sleep(0.001)
return 42
class TestFunction42(TestCase):
@deasync
async def test_function42(self):
result = await function42()
self.assertEquals(42, result)
نحوه نصب
نصب پکیج whl deasync-1.0.1:
pip install deasync-1.0.1.whl
نصب پکیج tar.gz deasync-1.0.1:
pip install deasync-1.0.1.tar.gz