Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 16, 2024
1 parent 8a588fa commit 2c77621
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/twisted/internet/test/test_inlinecb.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class TerminalException(Exception):
Just a specific exception type for use in inlineCallbacks tests in this
file.
"""

pass


Expand Down Expand Up @@ -127,6 +128,7 @@ def testHandledTerminalAsyncFailure(self):
Just like testHandledTerminalFailure, only with a Deferred which fires
asynchronously with an error.
"""

@inlineCallbacks
def _genHandledTerminalAsyncFailure(d):
try:
Expand All @@ -144,6 +146,7 @@ def testStackUsage(self):
Make sure we don't blow the stack when yielding immediately
available deferreds.
"""

@inlineCallbacks
def _genStackUsage():
for x in range(5000):
Expand All @@ -158,6 +161,7 @@ def testStackUsage2(self):
Make sure we don't blow the stack when yielding immediately
available values.
"""

@inlineCallbacks
def _genStackUsage2():
for x in range(5000):
Expand Down
9 changes: 8 additions & 1 deletion src/twisted/test/test_defgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def testBasics(self):
deferred which callbacks, as well as a deferred errbacks. Also
ensures returning a final value works.
"""

@deprecatedDeferredGenerator
def _genBasics():
x = waitForDeferred(getThing())
Expand Down Expand Up @@ -106,9 +107,12 @@ def testHandledTerminalFailure(self):
handles the exception which results. Assert that the Deferred
Generator does not errback its Deferred.
"""

@deprecatedDeferredGenerator
def _genHandledTerminalFailure():
x = waitForDeferred(defer.fail(TerminalException("Handled Terminal Failure")))
x = waitForDeferred(
defer.fail(TerminalException("Handled Terminal Failure"))
)
yield x
try:
x.getResult()
Expand All @@ -122,6 +126,7 @@ def testHandledTerminalAsyncFailure(self):
Just like testHandledTerminalFailure, only with a Deferred which fires
asynchronously with an error.
"""

@deprecatedDeferredGenerator
def _genHandledTerminalAsyncFailure(d):
x = waitForDeferred(d)
Expand All @@ -141,6 +146,7 @@ def testStackUsage(self):
Make sure we don't blow the stack when yielding immediately
available deferreds.
"""

@deprecatedDeferredGenerator
def _genStackUsage():
for x in range(5000):
Expand All @@ -157,6 +163,7 @@ def testStackUsage2(self):
Make sure we don't blow the stack when yielding immediately
available values.
"""

@deprecatedDeferredGenerator
def _genStackUsage2():
for x in range(5000):
Expand Down

0 comments on commit 2c77621

Please sign in to comment.