{ "info": { "author": "Calvin Smith", "author_email": "sapientdust+pytest-tornasync@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Testing" ], "description": "================\npytest-tornasync\n================\n\n.. image:: https://travis-ci.org/eukaryote/pytest-tornasync.svg?branch=master\n :target: https://travis-ci.org/eukaryote/pytest-tornasync\n\nA simple pytest plugin that provides some helpful fixtures for testing\nTornado (version 5.0 or newer) apps and easy handling of plain\n(undecoratored) native coroutine tests (Python 3.5+).\n\nWhy another Tornado pytest plugin when the excellent ``pytest-tornado`` already\nexists? The main reason is that I didn't want to have to decorate every test\ncoroutine with ``@pytest.mark.gen_test``. This plugin doesn't have anything\nlike ``gen_test``. Defining a test with ``async def`` and a name that\nbegins with ``test_`` is all that is required.\n\n\nInstallation\n------------\n\nInstall using pip, which must be run with Python 3.5+:\n\n.. code-block:: sh\n\n pip install pytest-tornasync\n\n\nUsage\n-----\n\nDefine an ``app`` fixture:\n\n.. code-block:: python\n\n import pytest\n\n\n @pytest.fixture\n def app():\n import yourapp\n return yourapp.make_app() # a tornado.web.Application\n\n\nCreate tests as native coroutines using Python 3.5+ ``async def``:\n\n.. code-block:: python\n\n async def test_app(http_server_client):\n resp = await http_server_client.fetch('/')\n assert resp.code == 200\n # ...\n\n\nFixtures\n--------\n\nWhen the plugin is installed, then ``pytest --fixtures`` will show\nthe fixtures that are available:\n\nhttp_server_port\n Port used by `http_server`.\nhttp_server\n Start a tornado HTTP server that listens on all available interfaces.\n\n You must create an `app` fixture, which returns\n the `tornado.web.Application` to be tested.\n\n Raises:\n FixtureLookupError: tornado application fixture not found\nhttp_server_client\n Create an asynchronous HTTP client that can fetch from `http_server`.\nhttp_client\n Create an asynchronous HTTP client that can fetch from anywhere.\nio_loop\n Create a new `tornado.ioloop.IOLoop` for each test case.\n\n\n\nExamples\n--------\n\n.. code-block:: python\n\n import time\n\n import tornado.web\n import tornado.gen\n\n import pytest\n\n\n class MainHandler(tornado.web.RequestHandler):\n def get(self):\n self.write(\"Hello, world!\")\n\n\n @pytest.fixture\n def app():\n return tornado.web.Application([(r\"/\", MainHandler)])\n\n\n async def test_http_server_client(http_server_client):\n # http_server_client fetches from the `app` fixture and takes path\n resp = await http_server_client.fetch('/')\n assert resp.code == 200\n assert resp.body == b\"Hello, world!\"\n\n\n async def test_http_client(http_client):\n # http_client fetches from anywhere and takes full URL\n resp = await http_client.fetch('http://httpbin.org/status/204')\n assert resp.code == 204\n\n\n async def example_coroutine(period):\n await tornado.gen.sleep(period)\n\n\n async def test_example():\n # no fixtures needed\n period = 1.0\n start = time.time()\n await example_coroutine(period)\n elapsed = time.time() - start\n assert elapsed >= period\n\n\nChanges\n=======\n\n0.6.0 (2018-11-19)\n------------------\n\n - minor updates to avoid a pytest warning under pytest 4\n - repo switch to using a 'src' dir\n\n\n0.5.0 (2018-05-28)\n------------------\n\n - updated to work with Tornado 5, which is now the minimum required version\n - require pytest >= 3.0\n - the `io_loop` fixture always refers to a `tornado.ioloop.IOLoop instance` now\n - the `io_loop_asyncio` and `io_loop_tornado` fixtures have been removed, since\n now that Tornado 5 always uses asyncio under Python 3, there would be no\n difference between the two fixtures, so `io_loop` is all that is needed\n - tox tests now test more versions of Tornado (5.0.* and latest 5.*),\n Pytest (3.0.* and latest 3.*), and Python (3.5, 3.6, 3.7, and pypy3).\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/eukaryote/pytest-tornasync", "keywords": "testing py.test tornado", "license": "http://www.opensource.org/licenses/mit-license.php", "maintainer": "", "maintainer_email": "", "name": "pytest-tornasync", "package_url": "https://pypi.org/project/pytest-tornasync/", "platform": "any", "project_url": "https://pypi.org/project/pytest-tornasync/", "project_urls": { "Homepage": "https://github.com/eukaryote/pytest-tornasync" }, "release_url": "https://pypi.org/project/pytest-tornasync/0.6.0.post2/", "requires_dist": [ "pytest (>=3.0)", "tornado (>=5.0)" ], "requires_python": "", "summary": "py.test plugin for testing Python 3.5+ Tornado code", "version": "0.6.0.post2" }, "last_serial": 5533889, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "bb00df7759efc30ec44d7c0d2187472d", "sha256": "bbed467a0ad42ceabb67f844dd66eb26bbbcd899f97fff0a077da3510bb9c2c9" }, "downloads": -1, "filename": "pytest_tornasync-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "bb00df7759efc30ec44d7c0d2187472d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7110, "upload_time": "2016-05-23T00:31:12", "url": "https://files.pythonhosted.org/packages/04/30/df41d16e6a150c8bf010d76079286a7bf45337dcec60e8f2c8b77d8d0a82/pytest_tornasync-0.2.0-py3-none-any.whl" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "9758a6d4d86451b4296bf03b4c4ac1af", "sha256": "4d2db70c1f9d8d8660ccece95bd2f6b438c81cdfa663a2b3a18789f15e9551eb" }, "downloads": -1, "filename": "pytest_tornasync-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9758a6d4d86451b4296bf03b4c4ac1af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7276, "upload_time": "2016-05-25T04:17:22", "url": "https://files.pythonhosted.org/packages/43/70/10a778570c91b3e80da934527e8f3659d33c96a428ef13cc3995b2c6aa32/pytest_tornasync-0.3.0-py3-none-any.whl" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "d3a65c6cc5938795528a5bd1d0f0e1e0", "sha256": "58bf90d1cfa1223ea57177754ffc8aa45d22e9087a824d98dc9c3f0232f6e0bd" }, "downloads": -1, "filename": "pytest_tornasync-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d3a65c6cc5938795528a5bd1d0f0e1e0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7280, "upload_time": "2016-08-25T19:22:27", "url": "https://files.pythonhosted.org/packages/03/b4/b3e7ee42eb5f798d9c6a3bd85ed6def578d8d08ea1156e5d97fcd4013228/pytest_tornasync-0.4.0-py3-none-any.whl" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "57ca41ff06acfb1ec19294919977af75", "sha256": "894241bd2134677bebcc6fb65c3004d67fbbbe32cb4af1010934fed4e382538e" }, "downloads": -1, "filename": "pytest_tornasync-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "57ca41ff06acfb1ec19294919977af75", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4842, "upload_time": "2018-05-28T20:26:00", "url": "https://files.pythonhosted.org/packages/85/95/5419a3c18aa0e7ac6d9c383d3c3291e0b8a1f789ebe80cae0a4207f6f89a/pytest_tornasync-0.5.0-py3-none-any.whl" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "de5265690d0ea44f2ee322f01a22c38d", "sha256": "91c9273dc84d76849e22674674fbd5ff7cdcdf9b5cbe076ad9cbe88c32ff9efc" }, "downloads": -1, "filename": "pytest_tornasync-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "de5265690d0ea44f2ee322f01a22c38d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4844, "upload_time": "2018-11-19T16:39:45", "url": "https://files.pythonhosted.org/packages/23/fa/7b43b5765acb69ff66c3f4def288949306daa45cde6aa21cfd4fca36cc8e/pytest_tornasync-0.6.0-py3-none-any.whl" } ], "0.6.0.post1": [ { "comment_text": "", "digests": { "md5": "18a281e09a0b5e536ffef820db9a1938", "sha256": "2452b1b1d6930f709ceb2bb87065b006b7eb96b120c6a630cce3f1847d584260" }, "downloads": -1, "filename": "pytest_tornasync-0.6.0.post1-py3-none-any.whl", "has_sig": false, "md5_digest": "18a281e09a0b5e536ffef820db9a1938", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4974, "upload_time": "2018-11-19T16:46:34", "url": "https://files.pythonhosted.org/packages/65/2a/55e9d8758ed7e26787a50eb9c78c0e839693cc24717aff7eef6c166ff51b/pytest_tornasync-0.6.0.post1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4891f8de318a3b2a9b0146b37b7f9aa0", "sha256": "5fe41d6d98d4650898c082a69338d25879cadd0e55805c9a02bc3eb7212a2ea1" }, "downloads": -1, "filename": "pytest-tornasync-0.6.0.post1.tar.gz", "has_sig": false, "md5_digest": "4891f8de318a3b2a9b0146b37b7f9aa0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5445, "upload_time": "2019-06-01T22:33:54", "url": "https://files.pythonhosted.org/packages/cd/8e/06d97fbd1a2a41b00dc63bcd296064bc1a7bb1a1905fbe2f639905a9edff/pytest-tornasync-0.6.0.post1.tar.gz" } ], "0.6.0.post2": [ { "comment_text": "", "digests": { "md5": "c9fa07eb02c044f5a1c943d9e723fc61", "sha256": "4b165b6ba76b5b228933598f456b71ba233f127991a52889788db0a950ad04ba" }, "downloads": -1, "filename": "pytest_tornasync-0.6.0.post2-py3-none-any.whl", "has_sig": false, "md5_digest": "c9fa07eb02c044f5a1c943d9e723fc61", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6634, "upload_time": "2019-07-15T08:41:12", "url": "https://files.pythonhosted.org/packages/50/b9/3615ebfc3120bb949c3725b50793f42c3230d0175d6cfd358ea8bb6928ff/pytest_tornasync-0.6.0.post2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c81f6f5975666e9bfaaa31a349ae3e17", "sha256": "d781b6d951a2e7c08843141d3ff583610b4ea86bfa847714c76edefb576bbe5d" }, "downloads": -1, "filename": "pytest-tornasync-0.6.0.post2.tar.gz", "has_sig": false, "md5_digest": "c81f6f5975666e9bfaaa31a349ae3e17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6201, "upload_time": "2019-07-15T08:41:13", "url": "https://files.pythonhosted.org/packages/54/a0/e096d3609793ea1c3bbf255f923da453b83728cfc9f10bcbab98d6932d74/pytest-tornasync-0.6.0.post2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c9fa07eb02c044f5a1c943d9e723fc61", "sha256": "4b165b6ba76b5b228933598f456b71ba233f127991a52889788db0a950ad04ba" }, "downloads": -1, "filename": "pytest_tornasync-0.6.0.post2-py3-none-any.whl", "has_sig": false, "md5_digest": "c9fa07eb02c044f5a1c943d9e723fc61", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6634, "upload_time": "2019-07-15T08:41:12", "url": "https://files.pythonhosted.org/packages/50/b9/3615ebfc3120bb949c3725b50793f42c3230d0175d6cfd358ea8bb6928ff/pytest_tornasync-0.6.0.post2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c81f6f5975666e9bfaaa31a349ae3e17", "sha256": "d781b6d951a2e7c08843141d3ff583610b4ea86bfa847714c76edefb576bbe5d" }, "downloads": -1, "filename": "pytest-tornasync-0.6.0.post2.tar.gz", "has_sig": false, "md5_digest": "c81f6f5975666e9bfaaa31a349ae3e17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6201, "upload_time": "2019-07-15T08:41:13", "url": "https://files.pythonhosted.org/packages/54/a0/e096d3609793ea1c3bbf255f923da453b83728cfc9f10bcbab98d6932d74/pytest-tornasync-0.6.0.post2.tar.gz" } ] }