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_params

Return default session creation parameters.

Source and package
Qualified name
libtmux.pytest_plugin.session_params
Module
libtmux.pytest_plugin
Package
libtmux
Source
src/libtmux/pytest_plugin.py
session_params () → dict[str, t.Any]

Description#

>>> import pytest
>>> from libtmux.session import Session
>>> @pytest.fixture
... def session_params(session_params):
... return {
... 'x': 800,
... 'y': 600,
... }
>>> 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][:4])
>>> pytester = request.getfixturevalue('pytester')
>>> pytester.makepyfile(**{'whatever.py': source})
PosixPath(...)
>>> result = pytester.runpytest('whatever.py', '--disable-warnings')
===...
>>> result.assert_outcomes(passed=1)

Discussed in Testing with libtmux

Esc

Type to search.

Reference preview Open reference