pytest-tornasync
py.test plugin for testing Python 3.5+ Tornado code
What it is and what it does
pytest-tornasync is a pytest plugin that simplifies testing of Tornado web applications by allowing you to write test functions as plain async def coroutines without decorator boilerplate. Instead of using @pytest.mark.gen_test, you simply name your test function with test_ prefix and define it as async, and the plugin automatically runs it in the Tornado IOLoop.
The plugin provides fixtures for common testing scenarios: http_server_client for making requests to a Tornado app under test, http_client for arbitrary HTTP requests, http_server_port for the test server's port, and io_loop for direct IOLoop access. You define an app fixture that returns your tornado.web.Application, and the plugin handles the rest. It targets Tornado 5.0+ and Python 3.5+, though the project is no longer actively maintained.
Use it for:
- Write async test functions for Tornado web handlers without @pytest.mark.gen_test decorators.
- Test HTTP endpoints of a Tornado application using http_server_client fixture.
- Verify async coroutine behavior in isolation with direct IOLoop access via the io_loop fixture.
- Make external HTTP requests in tests using the http_client fixture.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that runs native async test functions (defined with async def) against Tornado applications, providing fixtures for HTTP server testing and IO loop management.
Yes, if you are testing a Tornado application on Python 3.5–3.7 with pytest and Tornado 5.x. The plugin is stable and has no known vulnerabilities. However, do not use it if you need support for newer Tornado or pytest releases, as the project is abandoned and will not receive updates. For new projects or modern Tornado versions, verify compatibility first or consider alternatives.
Install
pytest-tornasync on PyPI
pip
pip install pytest-tornasyncuv
uv add pytest-tornasyncpoetry
poetry add pytest-tornasyncInstalling pytest-tornasync
Before you install
Low install friction with a pure-Python wheel. However, the package is abandoned—last release was 2019-07-15 and last commit 2023-05-24—so it will not receive bug fixes or updates for newer Tornado or pytest versions.
License in practice
MIT license (permissive) means you can use this freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install pytest-tornasync
import pytest
import tornado.web
@pytest.fixture
def app():
return tornado.web.Application([(r"/", MyHandler)])
async def test_app(http_server_client):
resp = await http_server_client.fetch('/')
assert resp.code == 200
Requires Python 3.5+ and Tornado 5.0 or newer. Tests must be defined as native coroutines (async def) to be recognized by the plugin.
Verify before relying
- Compatibility with Tornado versions released after 2019 and pytest versions beyond those tested in the last release.
- Whether the plugin works correctly with modern Python 3.8+ async/await semantics and event loop changes.
Package facts
| License | http://www.opensource.org/licenses/mit-license.php (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pytest, tornado |
| Maintenance | abandoned — 2,587 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 324,443/month — #7,594 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_tornasync-0.6.0.post2-py3-none-any.whl
Keywords: testing, py.test, tornado
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-tornadoA pytest plugin that provides fixtures and…
permissive · top 15,000 on PyPI
tornadoTornado is a Python web framework and…
permissive · top 1,000 on PyPI
pytest-aioA pytest plugin that automatically runs async…
permissive · top 15,000 on PyPI
pytest-twistedA pytest plugin that enables testing of…
permissive · top 15,000 on PyPI
terminadoTerminado provides a Tornado websocket backend…
permissive · top 1,000 on PyPI
threadloopRuns Tornado coroutines from synchronous Python…
permissive · top 15,000 on PyPI
pytest-dockerpytest-docker provides pytest fixtures that…
permissive · top 5,000 on PyPI
pytest-redisA pytest plugin that provides fixtures for…
copyleft · top 15,000 on PyPI
pytest-markdown-docsA pytest plugin that executes Python code…
permissive · top 15,000 on PyPI
pytest-aiohttpPytest plugin that provides fixtures for…
permissive · top 5,000 on PyPI