File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 44
55import pytest
66
7+ from _pytest .doctest import DoctestItem
78from _pytest .fixtures import SubRequest
89from _pytest .monkeypatch import MonkeyPatch
910
@@ -105,15 +106,12 @@ def session(request: SubRequest, server: Server) -> "Session":
105106
106107@pytest .fixture (autouse = True )
107108def add_doctest_fixtures (
109+ request : SubRequest ,
108110 doctest_namespace : t .Dict [str , t .Any ],
109- # usefixtures / autouse
110- clear_env : t .Any ,
111- # Normal fixtures
112- server : "Server" ,
113- session : "Session" ,
114111) -> None :
115- if which ("tmux" ):
116- doctest_namespace ["server" ] = server
112+ if isinstance (request ._pyfuncitem , DoctestItem ) and which ("tmux" ):
113+ doctest_namespace ["server" ] = request .getfixturevalue ("server" )
114+ session : "Session" = request .getfixturevalue ("session" )
117115 doctest_namespace ["session" ] = session
118116 doctest_namespace ["window" ] = session .attached_window
119117 doctest_namespace ["pane" ] = session .attached_pane
You can’t perform that action at this time.
0 commit comments