diff options
| author | Barry Warsaw | 2016-03-24 09:55:18 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-03-24 09:55:18 -0400 |
| commit | ce9370a537683e6e4e934b8018d0fe3f2aa7f9ac (patch) | |
| tree | 1c5ac62d66cfa75d6bf7abfb737ae401b49df2a8 /src/mailman/bin/tests/test_master.py | |
| parent | 8169b60bc3d5b771f3676ae12c65f6f92c67a76a (diff) | |
| download | mailman-ce9370a537683e6e4e934b8018d0fe3f2aa7f9ac.tar.gz mailman-ce9370a537683e6e4e934b8018d0fe3f2aa7f9ac.tar.zst mailman-ce9370a537683e6e4e934b8018d0fe3f2aa7f9ac.zip | |
Diffstat (limited to 'src/mailman/bin/tests/test_master.py')
| -rw-r--r-- | src/mailman/bin/tests/test_master.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/mailman/bin/tests/test_master.py b/src/mailman/bin/tests/test_master.py index 50f4d1ab5..32dbbceed 100644 --- a/src/mailman/bin/tests/test_master.py +++ b/src/mailman/bin/tests/test_master.py @@ -17,22 +17,16 @@ """Test master watcher utilities.""" -__all__ = [ - 'TestMasterLock', - ] - - import os -import errno import tempfile import unittest +from contextlib import suppress from datetime import timedelta from flufl.lock import Lock from mailman.bin import master - class TestMasterLock(unittest.TestCase): def setUp(self): fd, self.lock_file = tempfile.mkstemp() @@ -43,11 +37,8 @@ class TestMasterLock(unittest.TestCase): def tearDown(self): # Unlocking removes the lock file, but just to be safe (i.e. in case # of errors). - try: + with suppress(FileNotFoundError): os.remove(self.lock_file) - except OSError as error: - if error.errno != errno.ENOENT: - raise def test_acquire_lock_1(self): lock = master.acquire_lock_1(False, self.lock_file) |
