Barry Warsaw pushed to branch click-cli at mailman / Mailman

Commits:
7a5e2996 by Barry Warsaw at 2017-07-08T15:17:05-04:00
Fix aliases.rst.

Hopefully finally crush an intermittent test hang.

- - - - -


2 changed files:

- src/mailman/commands/docs/aliases.rst
- src/mailman/commands/tests/test_control.py


Changes:

=====================================
src/mailman/commands/docs/aliases.rst
=====================================
--- a/src/mailman/commands/docs/aliases.rst
+++ b/src/mailman/commands/docs/aliases.rst
@@ -8,10 +8,8 @@ server.  Generally these files are automatically kept 
up-to-date when mailing
 lists are created or removed, but you might occasionally need to manually
 regenerate the file.  The ``mailman aliases`` command does this.
 
-    >>> class FakeArgs:
-    ...     directory = None
-    >>> from mailman.commands.cli_aliases import Aliases
-    >>> command = Aliases()
+    >>> from mailman.commands.cli_aliases import aliases
+    >>> command = cli(aliases)
 
 For example, connecting Mailman to Postfix is generally done through the LMTP
 protocol.  Mailman starts an LMTP server and Postfix delivers messages to
@@ -28,17 +26,20 @@ generation.
     ... lmtp_port: 24
     ... """)
 
+..
+    Clean up.
+    >>> ignore = cleanups.callback(config.pop, 'postfix')
+
 Let's create a mailing list and then display the transport map for it.  We'll
 write the appropriate files to a temporary directory.
 ::
 
+    >>> mlist = create_list('a...@example.com')
+
     >>> import os, shutil, tempfile
     >>> output_directory = tempfile.mkdtemp()
     >>> ignore = cleanups.callback(shutil.rmtree, output_directory)
-
-    >>> FakeArgs.directory = output_directory
-    >>> mlist = create_list('t...@example.com')
-    >>> command.process(FakeArgs)
+    >>> command('--directory', output_directory)
 
 For Postfix, there are two files in the output directory.
 
@@ -54,15 +55,15 @@ The transport map file contains all the aliases for the 
mailing list.
     ...     print(fp.read())
     # AUTOMATICALLY GENERATED BY MAILMAN ON ...
     ...
-    t...@example.com               lmtp:[lmtp.example.com]:24
-    test-boun...@example.com       lmtp:[lmtp.example.com]:24
-    test-conf...@example.com       lmtp:[lmtp.example.com]:24
-    test-j...@example.com          lmtp:[lmtp.example.com]:24
-    test-le...@example.com         lmtp:[lmtp.example.com]:24
-    test-ow...@example.com         lmtp:[lmtp.example.com]:24
-    test-requ...@example.com       lmtp:[lmtp.example.com]:24
-    test-subscr...@example.com     lmtp:[lmtp.example.com]:24
-    test-unsubscr...@example.com   lmtp:[lmtp.example.com]:24
+    a...@example.com               lmtp:[lmtp.example.com]:24
+    ant-boun...@example.com       lmtp:[lmtp.example.com]:24
+    ant-conf...@example.com       lmtp:[lmtp.example.com]:24
+    ant-j...@example.com          lmtp:[lmtp.example.com]:24
+    ant-le...@example.com         lmtp:[lmtp.example.com]:24
+    ant-ow...@example.com         lmtp:[lmtp.example.com]:24
+    ant-requ...@example.com       lmtp:[lmtp.example.com]:24
+    ant-subscr...@example.com     lmtp:[lmtp.example.com]:24
+    ant-unsubscr...@example.com   lmtp:[lmtp.example.com]:24
     <BLANKLINE>
 
 The relay domains file contains a list of all the domains.
@@ -72,7 +73,3 @@ The relay domains file contains a list of all the domains.
     # AUTOMATICALLY GENERATED BY MAILMAN ON ...
     ...
     example.com example.com
-
-..
-    Clean up.
-    >>> config.pop('postfix')


=====================================
src/mailman/commands/tests/test_control.py
=====================================
--- a/src/mailman/commands/tests/test_control.py
+++ b/src/mailman/commands/tests/test_control.py
@@ -143,8 +143,7 @@ class TestStart(unittest.TestCase):
         except FileNotFoundError:
             # There is no master, so just ignore this.
             return
-        kill_watcher(signal.SIGTERM)
-        os.waitpid(master_pid, 0)
+        kill_with_extreme_prejudice(master_pid)
 
     def test_force_stale_lock(self):
         # Fake an acquisition of the master lock by another process, which



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/7a5e2996ee37c9b46350b0e1c5f091e6eb8c2794

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/7a5e2996ee37c9b46350b0e1c5f091e6eb8c2794
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