Core LibrarystableAPI Reference

Choose documentation 3

stable

Current version

stable
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

function libtmux stable

session

Return new, temporary libtmux.Session .

Source and package
Qualified name
libtmux.pytest_plugin.session
Module
libtmux.pytest_plugin
Package
libtmux
Source
src/libtmux/pytest_plugin.py
session ( request: pytest.FixtureRequest, session_params: dict[str, t.Any], server: Server, ) → Session

Description#

>>> from libtmux.session import Session
>>> def test_example(session: "Session") -> None:
... assert isinstance(session.name, str)
... assert session.name.startswith('libtmux_')
... window = session.new_window(window_name='new one')
... assert window.name == 'new one'

.. :

>>> locals().keys()
dict_keys(...)
>>> source = ''.join([e.source for e in request._pyfuncitem.dtest.examples][:3])
>>> pytester = request.getfixturevalue('pytester')
>>> pytester.makepyfile(**{'whatever.py': source})
PosixPath(...)
>>> result = pytester.runpytest('whatever.py', '--disable-warnings')
===...
>>> result.assert_outcomes(passed=1)
Parameters
Esc

Type to search.

Reference preview Open reference