diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-02-19 15:34:38 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-02-19 15:34:38 +0000 |
commit | 700487a7c72c769537fb04c56d2e9c6dd29d7f84 (patch) | |
tree | f13b8706f7cdc4faa6e44e207fd57d3cfe30f97f /tests/test_distributor.py | |
parent | Add Measures to presence (diff) | |
download | synapse-700487a7c72c769537fb04c56d2e9c6dd29d7f84.tar.xz |
Fix flake8 warnings for tests
Diffstat (limited to 'tests/test_distributor.py')
-rw-r--r-- | tests/test_distributor.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_distributor.py b/tests/test_distributor.py index a80f580ba6..acebcf4a86 100644 --- a/tests/test_distributor.py +++ b/tests/test_distributor.py @@ -44,8 +44,10 @@ class DistributorTestCase(unittest.TestCase): self.dist.declare("whine") d_inner = defer.Deferred() + def observer(): return d_inner + self.dist.observe("whine", observer) d_outer = self.dist.fire("whine") @@ -66,8 +68,8 @@ class DistributorTestCase(unittest.TestCase): observers[0].side_effect = Exception("Awoogah!") - with patch("synapse.util.distributor.logger", - spec=["warning"] + with patch( + "synapse.util.distributor.logger", spec=["warning"] ) as mock_logger: d = self.dist.fire("alarm", "Go") yield d @@ -77,8 +79,9 @@ class DistributorTestCase(unittest.TestCase): observers[1].assert_called_once_with("Go") self.assertEquals(mock_logger.warning.call_count, 1) - self.assertIsInstance(mock_logger.warning.call_args[0][0], - str) + self.assertIsInstance( + mock_logger.warning.call_args[0][0], str + ) @defer.inlineCallbacks def test_signal_catch_no_suppress(self): |