Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

function libtmux latest

TestServer

Create a temporary tmux server that cleans up after itself.

Source and package
Qualified name
libtmux.pytest_plugin.TestServer
Module
libtmux.pytest_plugin
Package
libtmux
Source
src/libtmux/pytest_plugin.py
TestServer (request: pytest.FixtureRequest) → type[Server]

Description#

This is similar to the server pytest fixture, but can be used outside of pytest. The server will be killed when the test completes.

Examples#

>>> server = Server() # Create server instance
>>> server.new_session()
Session($... ...)
>>> server.is_alive()
True
>>> # Each call creates a new server with unique socket
>>> server2 = Server()
>>> server2.socket_name != server.socket_name
True
Parameters
Esc

Type to search.

Reference previewOpen reference