jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1033102?usp=email )
Change subject: [doc] Update tests documentation ......................................................................
[doc] Update tests documentation
Change-Id: I4596f0f0702c43ad9efcdb0fcf73c75da1c9daca --- M tests/aspects.py M tests/setup_tests.py M tests/thanks_tests.py M tests/version_tests.py 4 files changed, 15 insertions(+), 20 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py index 157210c..039542a 100644 --- a/tests/aspects.py +++ b/tests/aspects.py @@ -1288,17 +1288,19 @@
"""Test cases use :mod:`pwb` to invoke scripts.
- Test cases which use pwb typically also access a site, and use the network. - Even during initialisation, scripts may call pywikibot.handle_args, which - initialises loggers and uses the network to determine if the code is stale. + Test cases which use pwb typically also access a site, and use the + network. Even during initialisation, scripts may call + :func:`pywikibot.handle_args`, which initialises loggers and uses + the network to determine if the code is stale.
- The flag 'pwb' is used by the TestCase metaclass to check that a test site - is set declared in the class properties, or that 'site = False' is added - to the class properties in the unlikely scenario that the test case - uses pwb in a way that doesn't use a site. + The flag 'pwb' is used by the TestCase metaclass to check that a + test site is set declared in the class properties, or that + :code:`site = False` is added to the class properties in the + unlikely scenario that the test case uses pwb in a way that doesn't + use a site.
- If a test class is marked as 'site = False', the metaclass will also check - that the 'net' flag is explicitly set. + If a test class is marked as :code:`site = False , the metaclass + will also check that the ``net`` flag is explicitly set. """
pwb = True diff --git a/tests/setup_tests.py b/tests/setup_tests.py index 174aed5..8263f3a 100755 --- a/tests/setup_tests.py +++ b/tests/setup_tests.py @@ -1,8 +1,5 @@ #!/usr/bin/env python3 -"""Test setup.py. - -.. versionadded:: 9.0 -""" +"""Test setup.py.""" # # (C) Pywikibot team, 2024 # diff --git a/tests/thanks_tests.py b/tests/thanks_tests.py index 04b6fc9..19e5ca9 100755 --- a/tests/thanks_tests.py +++ b/tests/thanks_tests.py @@ -30,9 +30,8 @@ def test_thank_revision(self): """Test thanks for normal revisions.
- .. note:: This test relies on activity in recentchanges, and - there must make edits made before reruns of this test. - .. seealso:: :phab:`T137836`. + This test relies on activity in recentchanges, and there must + make edits made before reruns of this test; see :phab:`T137836`. """ site = self.get_site() data = site.recentchanges(total=20) diff --git a/tests/version_tests.py b/tests/version_tests.py index 96a6de1..6da5b5d 100644 --- a/tests/version_tests.py +++ b/tests/version_tests.py @@ -1,8 +1,5 @@ #!/usr/bin/env python3 -"""Test cases for the :mod:`version` module. - -.. versionadded:: 9.2 -""" +"""Test cases for the :mod:`version` module.""" # # (C) Pywikibot team, 2024 #