mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-12 14:32:16 -04:00
Run Black on the tests again (#5170)
This commit is contained in:
parent
d9a02d1201
commit
b36c82576e
54 changed files with 818 additions and 1158 deletions
|
@ -42,10 +42,10 @@ class TimeoutDeferredTest(TestCase):
|
|||
self.assertNoResult(timing_out_d)
|
||||
self.assertFalse(cancelled[0], "deferred was cancelled prematurely")
|
||||
|
||||
self.clock.pump((1.0, ))
|
||||
self.clock.pump((1.0,))
|
||||
|
||||
self.assertTrue(cancelled[0], "deferred was not cancelled by timeout")
|
||||
self.failureResultOf(timing_out_d, defer.TimeoutError, )
|
||||
self.failureResultOf(timing_out_d, defer.TimeoutError)
|
||||
|
||||
def test_times_out_when_canceller_throws(self):
|
||||
"""Test that we have successfully worked around
|
||||
|
@ -59,9 +59,9 @@ class TimeoutDeferredTest(TestCase):
|
|||
|
||||
self.assertNoResult(timing_out_d)
|
||||
|
||||
self.clock.pump((1.0, ))
|
||||
self.clock.pump((1.0,))
|
||||
|
||||
self.failureResultOf(timing_out_d, defer.TimeoutError, )
|
||||
self.failureResultOf(timing_out_d, defer.TimeoutError)
|
||||
|
||||
def test_logcontext_is_preserved_on_cancellation(self):
|
||||
blocking_was_cancelled = [False]
|
||||
|
@ -80,10 +80,10 @@ class TimeoutDeferredTest(TestCase):
|
|||
# the errbacks should be run in the test logcontext
|
||||
def errback(res, deferred_name):
|
||||
self.assertIs(
|
||||
LoggingContext.current_context(), context_one,
|
||||
"errback %s run in unexpected logcontext %s" % (
|
||||
deferred_name, LoggingContext.current_context(),
|
||||
)
|
||||
LoggingContext.current_context(),
|
||||
context_one,
|
||||
"errback %s run in unexpected logcontext %s"
|
||||
% (deferred_name, LoggingContext.current_context()),
|
||||
)
|
||||
return res
|
||||
|
||||
|
@ -94,11 +94,10 @@ class TimeoutDeferredTest(TestCase):
|
|||
self.assertIs(LoggingContext.current_context(), LoggingContext.sentinel)
|
||||
timing_out_d.addErrback(errback, "timingout")
|
||||
|
||||
self.clock.pump((1.0, ))
|
||||
self.clock.pump((1.0,))
|
||||
|
||||
self.assertTrue(
|
||||
blocking_was_cancelled[0],
|
||||
"non-completing deferred was not cancelled",
|
||||
blocking_was_cancelled[0], "non-completing deferred was not cancelled"
|
||||
)
|
||||
self.failureResultOf(timing_out_d, defer.TimeoutError, )
|
||||
self.failureResultOf(timing_out_d, defer.TimeoutError)
|
||||
self.assertIs(LoggingContext.current_context(), context_one)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue