File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,24 @@ def fin() -> None:
122
122
123
123
@pytest .fixture (scope = "function" )
124
124
def session (request : pytest .FixtureRequest , server : Server ) -> "Session" :
125
- """Returns a new, temporary :class:`libtmux.Session`"""
125
+ """Returns a new, temporary :class:`libtmux.Session`
126
+
127
+ >>> from libtmux import Session
128
+
129
+ >>> def test_example(session: "Session"):
130
+ ... assert isinstance(session.name, str)
131
+ ... assert session.name.startswith('libtmux_')
132
+ ... window = session.new_window(window_name='new one')
133
+ ... assert window.name == 'new one'
134
+
135
+ >>> import inspect
136
+
137
+ >>> test_mod = pytester.makepyfile(whatever=inspect.getsource(test_example))
138
+ >>> result = pytester.inline_run(str(test_mod), '--disable-warnings')
139
+ ===...
140
+
141
+ >>> result.assertoutcome(passed=1)
142
+ """
126
143
session_name = "tmuxp"
127
144
128
145
if not server .has_session (session_name ):
You can’t perform that action at this time.
0 commit comments