File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 8
8
from _pytest .monkeypatch import MonkeyPatch
9
9
10
10
from libtmux import exc
11
+ from libtmux .common import which
11
12
from libtmux .server import Server
12
13
from libtmux .test import TEST_SESSION_PREFIX , get_test_session_name , namer
13
14
@@ -100,3 +101,17 @@ def session(request: SubRequest, server: Server) -> "Session":
100
101
assert TEST_SESSION_NAME != "tmuxp"
101
102
102
103
return session
104
+
105
+
106
+ @pytest .fixture (autouse = True )
107
+ def add_doctest_fixtures (
108
+ doctest_namespace : dict [str , t .Any ],
109
+ # usefixtures / autouse
110
+ clear_env : t .Any ,
111
+ # Normal fixtures
112
+ server : "Server" ,
113
+ session : "Session" ,
114
+ ) -> None :
115
+ if which ("tmux" ):
116
+ doctest_namespace ["server" ] = server
117
+ doctest_namespace ["session" ] = session
You can’t perform that action at this time.
0 commit comments