pytest_plugin

Module Contents

Functions

pytest_addoption(parser)
pytest_fixture_setup(fixturedef) Allow fixtures to be coroutines. Run coroutine fixtures in an event loop.
fast(request) –fast config option
loop_debug(request) –enable-loop-debug config option
_runtime_warning_context() Context manager which checks for RuntimeWarnings, specifically to
_passthrough_loop_context(loop,fast=False) setups and tears down a loop unless one is passed in via the loop
pytest_pycollect_makeitem(collector,name,obj) Fix pytest collecting for coroutines.
pytest_pyfunc_call(pyfuncitem) Run coroutines in an event loop instead of a normal function call.
pytest_generate_tests(metafunc)
loop(loop_factory,fast,loop_debug) Return an instance of the event loop.
unused_port(aiohttp_unused_port)
aiohttp_unused_port() Return a port that is unused on the current host.
aiohttp_server(loop) Factory to create a TestServer instance, given an app.
test_server(aiohttp_server)
aiohttp_raw_server(loop) Factory to create a RawTestServer instance, given a web handler.
raw_test_server(aiohttp_raw_server)
aiohttp_client(loop) Factory to create a TestClient instance.
test_client(aiohttp_client)
pytest_addoption(parser)
pytest_fixture_setup(fixturedef)

Allow fixtures to be coroutines. Run coroutine fixtures in an event loop.

fast(request)

–fast config option

loop_debug(request)

–enable-loop-debug config option

_runtime_warning_context()

Context manager which checks for RuntimeWarnings, specifically to avoid “coroutine ‘X’ was never awaited” warnings being missed.

If RuntimeWarnings occur in the context a RuntimeError is raised.

_passthrough_loop_context(loop, fast=False)

setups and tears down a loop unless one is passed in via the loop argument when it’s passed straight through.

pytest_pycollect_makeitem(collector, name, obj)

Fix pytest collecting for coroutines.

pytest_pyfunc_call(pyfuncitem)

Run coroutines in an event loop instead of a normal function call.

pytest_generate_tests(metafunc)
loop(loop_factory, fast, loop_debug)

Return an instance of the event loop.

unused_port(aiohttp_unused_port)
aiohttp_unused_port()

Return a port that is unused on the current host.

aiohttp_server(loop)

Factory to create a TestServer instance, given an app.

aiohttp_server(app, **kwargs)

test_server(aiohttp_server)
aiohttp_raw_server(loop)

Factory to create a RawTestServer instance, given a web handler.

aiohttp_raw_server(handler, **kwargs)

raw_test_server(aiohttp_raw_server)
aiohttp_client(loop)

Factory to create a TestClient instance.

aiohttp_client(app, **kwargs) aiohttp_client(server, **kwargs) aiohttp_client(raw_server, **kwargs)

test_client(aiohttp_client)