A pytest plugin that enables tmux driven tests
This plugin is intend to help users who want to test interrative cli.
When using tmux
fixture it basically :
Until a stable release, it is greatly encouraged to specify a strict version if you use this tool in your CI since it is in its early development and could be greatly changed between version.
https://pytest-tmux.readthedocs.io/
You can install "pytest-tmux" via pip from PyPI:
$ pip install pytest-tmux
Configuration could be set on different level (in order of precedence):
tmux.config.session
tmux.config.session
tmux.screen() / tmux.row()
with timeout
/ delay
argumentimport pytest
from inspect import cleandoc
def test_assert(tmux):
# Set some options before session / windows is started
tmux.config.session.window_command='env -i PS1="$ " TERM="xterm-256color" /usr/bin/env bash --norc --noprofile'
assert tmux.screen() == '$'
tmux.send_keys(r'printf " Hello World .\n\n"')
expected=r"""
$ printf " Hello World .\n\n"
Hello World .
$
"""
assert tmux.screen() == cleandoc(expected)
Distributed under the terms of the MIT license, "pytest-tmux" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.