Skip to content

Commit

Permalink
doc: exclude Testdir.Session (#519)
Browse files Browse the repository at this point in the history
* doc: exclude Testdir.Session

`Testdir.Session` appears to be there for convenience only, and is used
in internal tests.
This patch excludes it from `Testdir`'s documentation, which causes
duplicate cross-references for `Session` in Sphinx.

* Move setting of Testdir.Session up
  • Loading branch information
blueyed authored Jan 1, 2022
1 parent b348989 commit acf27a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion doc/en/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,9 @@ To use it, include in your top-most ``conftest.py`` file:
.. autoclass:: Testdir()
.. autoclass:: Testdir
:members:
:exclude-members: Session

.. autoclass:: RunResult()
:members:
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/pytester/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@ class Testdir(Generic[AnyStr]):
CLOSE_STDIN = CLOSE_STDIN
"""Sentinel to close stdin."""

Session = Session

class TimeoutExpired(Exception):
pass

Expand Down Expand Up @@ -911,8 +913,6 @@ def copy_example(self, name=None):
'example "{}" is not found as a file or directory'.format(example_path)
)

Session = Session

def getnode(self, config, arg):
"""Return the collection node of a file.
Expand Down

0 comments on commit acf27a6

Please sign in to comment.