skillfed

pytest-tornasync

py.test plugin for testing Python 3.5+ Tornado code

pytest-tornasync v0.6.0.post2 324.4K downloads/30d#7,594 on PyPI24
Permissive license http://www.opensource.org/licenses/mit-license.php Abandoned released

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-tornasync

uv

uv add pytest-tornasync

poetry

poetry add pytest-tornasync

Installing 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

Development Status :: 3 - AlphaEnvironment :: ConsoleFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Software Development :: Testing

Tags

pytest tornado async testingtornado test fixturesasync def pytest plugintornado http server testingpytest tornado integration
tornado-testingasync-fixtures

More Testing packages