{"id":23443413,"url":"https://github.com/kwarunek/aiounittest","last_synced_at":"2025-04-13T04:09:33.040Z","repository":{"id":24082484,"uuid":"100539051","full_name":"kwarunek/aiounittest","owner":"kwarunek","description":"Test python asyncio-based code with ease.","archived":false,"fork":false,"pushed_at":"2025-03-07T07:31:43.000Z","size":83,"stargazers_count":58,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T02:14:22.236Z","etag":null,"topics":["async-python","asyncio","unittest"],"latest_commit_sha":null,"homepage":"http://aiounittest.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kwarunek.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-16T22:50:25.000Z","updated_at":"2025-03-07T07:26:56.000Z","dependencies_parsed_at":"2025-03-21T17:16:09.956Z","dependency_job_id":null,"html_url":"https://github.com/kwarunek/aiounittest","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwarunek%2Faiounittest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwarunek%2Faiounittest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwarunek%2Faiounittest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwarunek%2Faiounittest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwarunek","download_url":"https://codeload.github.com/kwarunek/aiounittest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654095,"owners_count":21140236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-python","asyncio","unittest"],"created_at":"2024-12-23T18:19:06.865Z","updated_at":"2025-04-13T04:09:33.016Z","avatar_url":"https://github.com/kwarunek.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"aiounittest\n===========\n\n|image0|_ |image1|_\n\n.. |image0| image:: https://api.travis-ci.com/kwarunek/aiounittest.svg?branch=master\n.. _image0: https://travis-ci.com/kwarunek/aiounittest\n\n.. |image1| image:: https://badge.fury.io/py/aiounittest.svg\n.. _image1: https://badge.fury.io/py/aiounittest\n\nInfo\n====\n\nThe `aiounittest` is a helper library to ease of your pain (and boilerplate), when writing a test of the asynchronous code (:code:`asyncio`). You can test:\n\n* synchronous code (same as the :code:`unittest.TestCase`)\n* asynchronous code, it supports syntax with :code:`async`/:code:`await` (Python 3.5+) and :code:`asyncio.coroutine`/:code:`yield from` (Python 3.4)\n\n\nIn the Python 3.8 (`release note \u003chttps://docs.python.org/3/whatsnew/3.8.html#unittest\u003e`_) and newer consider to use the `unittest.IsolatedAsyncioTestCase \u003chttps://docs.python.org/3/library/unittest.html#unittest.IsolatedAsyncioTestCase\u003e`_. Builtin :code:`unittest` module is now asyncio-featured.\n\n\nInstallation\n============\n\nUse pip:\n\n::\n\n    pip install aiounittest\n\n\nUsage\n=====\n\nIt's as simple as use of :code:`unittest.TestCase`. Full docs at http://aiounittest.readthedocs.io.\n\n.. code-block:: python\n\n    import asyncio\n    import aiounittest\n\n\n    async def add(x, y):\n        await asyncio.sleep(0.1)\n        return x + y\n\n    class MyTest(aiounittest.AsyncTestCase):\n\n        async def test_async_add(self):\n            ret = await add(5, 6)\n            self.assertEqual(ret, 11)\n\n        # or 3.4 way\n        @asyncio.coroutine\n        def test_sleep(self):\n            ret = yield from add(5, 6)\n            self.assertEqual(ret, 11)\n\n        # some regular test code\n        def test_something(self):\n            self.assertTrue(True)\n\nLibrary provides some additional tooling:\n\n* async_test_,\n* AsyncMockIterator_ mocking for `async for`,\n* futurized_ mock for coroutines.\n\n.. _futurized: http://aiounittest.readthedocs.io/en/latest/futurized.html\n.. _async_test: http://aiounittest.readthedocs.io/en/latest/async_test.html\n.. _AsyncMockIterator: http://aiounittest.readthedocs.io/en/latest/asyncmockiterator.html\n\nLicense\n=======\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwarunek%2Faiounittest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwarunek%2Faiounittest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwarunek%2Faiounittest/lists"}