Skip to content

Commit 8ad5ec4

Browse files
committed
tests(pytest_plugin): Pull pytester independently in tests
1 parent 399f3a5 commit 8ad5ec4

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

conftest.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/libtmux/conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
def add_doctest_fixtures(
1717
request: pytest.FixtureRequest,
1818
doctest_namespace: t.Dict[str, t.Any],
19-
pytester: pytest.Pytester,
2019
) -> None:
2120
if isinstance(request._pyfuncitem, DoctestItem) and shutil.which("tmux"):
2221
request.getfixturevalue("set_home")
@@ -25,7 +24,6 @@ def add_doctest_fixtures(
2524
doctest_namespace["session"] = session
2625
doctest_namespace["window"] = session.attached_window
2726
doctest_namespace["pane"] = session.attached_pane
28-
doctest_namespace["pytester"] = pytester
2927
doctest_namespace["request"] = request
3028

3129

src/libtmux/pytest_plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ def server(
127127
... example.source for example in request._pyfuncitem.dtest.examples
128128
... ][:3])
129129
130+
>>> pytester = request.getfixturevalue('pytester')
131+
130132
>>> pytester.makepyfile(**{'whatever.py': source})
131133
PosixPath(...)
132134
@@ -164,6 +166,8 @@ def session(request: pytest.FixtureRequest, server: Server) -> "Session":
164166
165167
>>> import inspect
166168
169+
>>> pytester = request.getfixturevalue('pytester')
170+
167171
>>> test_mod = pytester.makepyfile(whatever=inspect.getsource(test_example))
168172
>>> result = pytester.inline_run(str(test_mod), '--disable-warnings')
169173
===...

0 commit comments

Comments
 (0)