Skip to main content
Tornado-Tester
==============

Testing tool of tornado web for any testing libraries.

Contextual Tester
-----------------

You can use testing tool by using 'with' statement. ::

import unittest
from tornado_tester import gen_test, Tester

from yourapplication import app

class Test(unittest.TestCase):
@gen_test
def test_app():
with Tester(app) as tester:
response = yield tester.http_client(tester.url_for('/hello'))
...

By using :meth:`url_for` you can make URL with current HTTP server's address.

And you can use it for py.test like. ::

import pytest
from tornado_tester import gen_test, Tester

from yourapplication import app


@pytest.fixture
def tester(request):
tester = Tester(app)

tester.setup()
request.addfinalizer(tester.teardown)
return tester


@gen_test
def test_app(tester):
response = yield tester.http_client(tester.url_for('/hello'))
...

.. warning::
You can't use multiple Testers in one gen_test by default.

You should provide a shared I/O loop to use multiple tester. ::

import pytest
from tornado.ioloop import IOLoop
from tornado_tester import gen_test, Tester

from yourapplication import app


@gen_test
def test_app():
loop = IOLoop()
tester1 = Tester(app, io_loop=loop)
tester2 = Tester(app, io_loop=loop)

with tester1:
...

with tester2:
...

Metadata

Release files for Tornado-Tester 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Tornado-Tester 0.1.1
File Size Uploaded Provenance Actions
Tornado-Tester-0.1.1.tar.gz 1.4 kB Without provenance Details for Tornado-Tester-0.1.1.tar.gz

Release files / Tornado-Tester-0.1.1.tar.gz

Download URL Tornado-Tester-0.1.1.tar.gz
Size 1.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b692439af6d058d3ac4c954e99e88dcde93e37ed9973f14b7640a593898a3b43
BLAKE2b-256 checksum
How to use checksums
ed6cf10c27e93cdcaa3b0ad72846fe091a470ccc7159fb82857c23b144483878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Tornado-Tester 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page