--- id: pytest-tornado version: "0.8.1" license: Apache License, Version 2.0 license_treatment: permissive maintenance: abandoned --- # pytest-tornado — A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. License: permissive · Maintenance: abandoned · Downloads: 378.3K/mo ## What it is and what it does pytest-tornado is a pytest plugin that bridges the gap between pytest's synchronous test model and Tornado's asynchronous event loop. It provides fixtures (io_loop, http_server, http_client, base_url, http_port) and a gen_test marker that let you write tests for Tornado web applications using both generator-based coroutines (yield) and modern async/await syntax. The plugin manages the IOLoop lifecycle per test, spins up temporary HTTP/HTTPS servers, and handles timeouts automatically. You define a Tornado application as a pytest fixture, then write test functions marked with @pytest.mark.gen_test that can yield or await HTTP requests. The plugin injects fixtures like http_client and base_url so your test can make requests to the test server and verify responses. It also supports HTTPS testing when you provide an ssl_options fixture. Use it for: - Test Tornado RequestHandler classes by making HTTP requests through http_client and verifying response codes and body content. - Write async integration tests that exercise both client and server concurrently using run_sync=False to keep them on the same IOLoop. - Validate HTTPS endpoints by providing ssl_options and using https_server and https_client fixtures. - Test WebSocket handlers and other async Tornado features that require a running IOLoop and real HTTP server. - Migrate legacy Tornado test suites from older test runners to pytest while preserving async test patterns. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that provides fixtures and markers to test asynchronous Tornado web applications, handling async/await and generator-based coroutine tests with built-in HTTP server and client support. Yes, if you are actively testing a Tornado application and want pytest integration—it eliminates boilerplate for IOLoop and server setup. However, be cautious: the project is abandoned (last release June 2020, no commits since). It works for current Tornado and pytest versions, but you should monitor compatibility and be prepared to fork or switch if breaking changes occur in either dependency. No security vulnerabilities are known. ## Install pip install pytest-tornado uv add pytest-tornado poetry add pytest-tornado ## Installing pytest-tornado Before you install: Low install friction with a pure-Python wheel. However, the package is abandoned—last release was 2020-06-17 and no commits since then. It remains marked Production/Stable and has seen no security issues, but you should expect no maintenance for compatibility with newer pytest or Tornado versions. License in practice: Licensed under Apache License 2.0 (permissive), so you can use, modify, and distribute it freely with minimal restrictions. No license-based barriers to adoption. Quickstart: pip install pytest-tornado import pytest import tornado.web @pytest.fixture def app(): return tornado.web.Application([(r"/", MyHandler)]) @pytest.mark.gen_test def test_example(http_client, base_url): response = yield http_client.fetch(base_url) assert response.code == 200 Requires pytest and tornado to be installed; gen_test tests default to a 5-second timeout (configurable via ASYNC_TEST_TIMEOUT environment variable or marker argument). Verify before relying: - Compatibility with current pytest and Tornado major versions (last tested 2020-06-17) - Whether async/await syntax support is fully stable across all test patterns - HTTPS testing prerequisites and certificate handling details ## Package facts - License: Apache License, Version 2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 378.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest tornado testing, async tornado test fixtures, tornado web app testing, pytest async coroutine marker, tornado http server testing, pytest gen_test decorator, tornado ioloop pytest plugin, tornado-testing, async-fixtures, pytest-plugin [View on SkillFed](https://skillfed.io/packages/pytest-tornado) · [View on PyPI](https://pypi.org/project/pytest-tornado/)