Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core


Commits:
66f98d70 by Abhilash Raj at 2019-12-14T15:30:41-08:00
Add a new section for documentation helpers.

- - - - -
43a91e9d by Abhilash Raj at 2019-12-14T23:40:22+00:00
Merge branch 'test-helpers' into 'master'

Add a new section for documentation helpers.

See merge request mailman/mailman!580
- - - - -


4 changed files:

- README.rst
- conf.py
- + src/mailman/docs/documentation.rst
- src/mailman/testing/documentation.py


Changes:

=====================================
README.rst
=====================================
@@ -60,6 +60,7 @@ Table of Contents
     src/mailman/docs/mta
     src/mailman/docs/postorius
     src/mailman/docs/hyperkitty
+    src/mailman/docs/documentation
     src/mailman/plugins/docs/intro
     src/mailman/docs/contribute
     src/mailman/docs/STYLEGUIDE


=====================================
conf.py
=====================================
@@ -210,6 +210,11 @@ latex_documents = [
 #latex_domain_indices = True
 
 
+autodoc_mock_imports = [
+    "mailman.testing.helpers"
+]
+
+
 # -- Options for manual page output 
--------------------------------------------
 
 # One entry per manual page. List of tuples


=====================================
src/mailman/docs/documentation.rst
=====================================
@@ -0,0 +1,22 @@
+Documentation Helpers
+=====================
+
+.. autofunction:: mailman.testing.documentation.dump_msgdata
+
+
+.. autofunction:: mailman.testing.documentation.dump_list
+
+
+.. autofunction:: mailman.testing.documentation.dump_json
+
+
+.. autofunction:: mailman.testing.documentation.call_http
+
+
+.. autofunction:: mailman.testing.documentation.cli
+
+
+.. autofunction:: mailman.testing.documentation.run_mailman
+
+
+.. autofunction:: mailman.app.lifecycle.create_list


=====================================
src/mailman/testing/documentation.py
=====================================
@@ -162,10 +162,13 @@ def dump_json(url, data=None, method=None, username=None, 
password=None):
 
 @public
 def cli(command_path):
-    # Use this to invoke click commands in doctests.  This returns a partial
-    # that accepts a sequence of command line options, invokes the click
-    # command, and returns the results (unless the keyword argument 'quiet')
-    # is True.
+    """Call a CLI command in doctests.
+
+    Use this to invoke click commands in doctests.  This returns a partial
+    that accepts a sequence of command line options, invokes the click
+    command, and returns the results (unless the keyword argument 'quiet')
+    is True.
+    """
     package_path, dot, name = command_path.rpartition('.')
     command = getattr(import_module(package_path), name)
     def inner(command_string, quiet=False, input=None):           # noqa: E306
@@ -186,6 +189,7 @@ def cli(command_path):
 
 @public
 def run_mailman(args, **overrides):
+    """Execute `mailman` command with the given arguments and return output."""
     exe = os.path.join(os.path.dirname(sys.executable), 'mailman')
     env = os.environ.copy()
     env.update(overrides)



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/c239a9937d6076aa9ce1e0045ac7e6bdc0f39c37...43a91e9d65dd6a15c7e71d45ceb209f050ab7e3e

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/c239a9937d6076aa9ce1e0045ac7e6bdc0f39c37...43a91e9d65dd6a15c7e71d45ceb209f050ab7e3e
You're receiving this email because of your account on gitlab.com.


_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to