Skip to content

Commit 993ee06

Browse files
committed
fix(pytest_plugin): clean up docstrings for autofixture extension compatibility
why: The new sphinx_pytest_fixtures extension auto-generates "Used by" and "Returns" fields from introspection, so hand-written duplicates cause double rendering. Cross-references also need :fixture: role instead of :func: to resolve against the new py:fixture domain object. what: - Change :func:`user_path` to :fixture:`user_path` in home_user_name docstring - Remove manual "Used by: :func:`config_file`, :func:`zshrc`" from user_path docstring (now auto-generated) - Remove redundant Returns section from TestServer docstring (return type is inferred from the annotation)
1 parent 832206b commit 993ee06

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/libtmux/pytest_plugin.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ def home_path(tmp_path_factory: pytest.TempPathFactory) -> pathlib.Path:
3232

3333
@pytest.fixture(scope="session")
3434
def home_user_name() -> str:
35-
"""Return default username to set for :func:`user_path` fixture."""
35+
"""Return default username to set for :fixture:`user_path` fixture."""
3636
return getpass.getuser()
3737

3838

3939
@pytest.fixture(scope="session")
4040
def user_path(home_path: pathlib.Path, home_user_name: str) -> pathlib.Path:
4141
"""Ensure and return temporary user directory.
4242
43-
Used by: :func:`config_file`, :func:`zshrc`
44-
4543
Note: You will need to set the home directory, see :ref:`set_home`.
4644
"""
4745
p = home_path / home_user_name
@@ -274,11 +272,6 @@ def TestServer(
274272
This is similar to the server pytest fixture, but can be used outside of pytest.
275273
The server will be killed when the test completes.
276274
277-
Returns
278-
-------
279-
type[Server]
280-
A factory function that returns a Server with a unique socket_name
281-
282275
Examples
283276
--------
284277
>>> server = Server() # Create server instance

0 commit comments

Comments
 (0)