{ "info": { "author": "Derek Yu", "author_email": "derek-nis@hotmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: AsyncIO", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Testing" ], "description": "# asyncnostic\nUsing pytest to run unit-tests that now need to run async?\nThis package serves as a catch-all for mixing regular and asynchronous tests.\n\n```py\nimport unittest\nimport asyncio\nfrom asyncnostic import asyncnostic\n\n# if your test class has no async components to it at all\n# asyncnostic will stay out of your way\n@asyncnostic\nclass TestAThing(unittest.TestCase):\n\n # the kwarg \"loop\" as an method argument is optional\n # If you don't want it, leave it out.\n # The event loop will be the same for all tests\n # we keep the same setUp and tearDown naming conventions from unittest\n async def setUp(self, loop):\n self.device = Device()\n await self.device.start(loop)\n\n # as long as your tests start with convention - starting in \"test\"\n # asyncnostic will pick them up\n async def test_async_simple(self, loop):\n result = await self.device.property\n assert result\n\n # we even handle regular tests thrown into the mix\n # you can even ask for the loop if you want\n def test_regular_simple(self, loop):\n assert self.device.loop == loop\n\n```\n\n### How it works under the hood\nWe find all coroutines that start with \"test\", as is convention. These tests are then transformed into regular methods, and the asynchronous test is overwritten by the regular test method with the same name. Tests that are not asynchronous are left unchanged. If any of the tests request a loop, the event loop (unique per class) will be passed as a keyword argument.\n\n### Contributing\nFeel free to open a PR or and issue if there's any problem with `Asyncnostic`! If you do open a PR, make sure to have run `nox` before review :)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DerekYu177/asyncnostic", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "asyncnostic", "package_url": "https://pypi.org/project/asyncnostic/", "platform": "", "project_url": "https://pypi.org/project/asyncnostic/", "project_urls": { "Homepage": "https://github.com/DerekYu177/asyncnostic" }, "release_url": "https://pypi.org/project/asyncnostic/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "simple way of using pytest with async unit tests", "version": "0.1.0" }, "last_serial": 5580650, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d91769478c1f22e305d8665461ab119f", "sha256": "c79432ff0303ad7532f5e808a0f4914459b5dbe10b540da1bc47d53a4f36960f" }, "downloads": -1, "filename": "asyncnostic-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d91769478c1f22e305d8665461ab119f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4741, "upload_time": "2019-07-25T01:18:28", "url": "https://files.pythonhosted.org/packages/9e/dd/15c5cf718b77117995da153e669efcb805ed9735b4729e1e7746a7655b40/asyncnostic-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5cb08eb1d3b81cde806bf30de5677d6e", "sha256": "717eb0d334788ce6500ea1b3cff75212142ebc92a439f13009f851a3b8c8b7ec" }, "downloads": -1, "filename": "asyncnostic-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5cb08eb1d3b81cde806bf30de5677d6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3184, "upload_time": "2019-07-25T01:18:31", "url": "https://files.pythonhosted.org/packages/22/dc/81ad2242dc5625b7ab42803c4205acf9c38548b8f6f115bc885a118247fe/asyncnostic-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d91769478c1f22e305d8665461ab119f", "sha256": "c79432ff0303ad7532f5e808a0f4914459b5dbe10b540da1bc47d53a4f36960f" }, "downloads": -1, "filename": "asyncnostic-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d91769478c1f22e305d8665461ab119f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4741, "upload_time": "2019-07-25T01:18:28", "url": "https://files.pythonhosted.org/packages/9e/dd/15c5cf718b77117995da153e669efcb805ed9735b4729e1e7746a7655b40/asyncnostic-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5cb08eb1d3b81cde806bf30de5677d6e", "sha256": "717eb0d334788ce6500ea1b3cff75212142ebc92a439f13009f851a3b8c8b7ec" }, "downloads": -1, "filename": "asyncnostic-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5cb08eb1d3b81cde806bf30de5677d6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3184, "upload_time": "2019-07-25T01:18:31", "url": "https://files.pythonhosted.org/packages/22/dc/81ad2242dc5625b7ab42803c4205acf9c38548b8f6f115bc885a118247fe/asyncnostic-0.1.0.tar.gz" } ] }