Skip to content

Commit ff06d3f

Browse files
committed
docs(CHANGES): Add pytest-plugin example
1 parent 3c01651 commit ff06d3f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/pytest-plugin/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,30 @@ options:
6969

7070
You could also read the code and override {func}`server fixtures <libtmux.pytest_plugin.server>`'s in your own doctest. doctest.
7171

72+
(custom_session_params)=
73+
74+
### Custom session parameters
75+
76+
You can override `session_params` to custom the `session` fixture. The
77+
dictionary will directly pass into :meth:`Server.new_sesion` keyword arguments.
78+
79+
```python
80+
import pytest
81+
82+
@pytest.fixture
83+
def session_params():
84+
return {
85+
'x': 800,
86+
'y': 600
87+
}
88+
89+
90+
def test_something(session):
91+
assert session
92+
```
93+
94+
The above will assure the libtmux session launches with `-x 800 -y 600`.
95+
7296
(set_home)=
7397

7498
### Setting a temporary home directory

0 commit comments

Comments
 (0)