[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2024-10-24 13:22:29 +00:00
parent 9db8b13d9c
commit b33661ff8e
2 changed files with 14 additions and 10 deletions

View File

@@ -231,7 +231,7 @@ def test_when_decorates_a_whenable():
self.handler = None
self.args = None
self.kwargs = None
def trigger(self):
"""
Triggers the whenable object, resulting in the handler being
@@ -242,7 +242,7 @@ def test_when_decorates_a_whenable():
"args": self.args,
"kwargs": self.kwargs,
}
self.handler(result) # call the handler
self.handler(result) # call the handler
def __when__(self, handler, *args, **kwargs):
"""
@@ -269,7 +269,7 @@ def test_when_decorates_a_whenable():
counter += 1
assert result["args"] == ("foo", "bar")
assert result["kwargs"] == {"baz": "qux"}
# The function should not be called until the whenable object is triggered.
assert counter == 0
# Trigger the whenable object.
@@ -294,7 +294,7 @@ def test_when_called_with_a_whenable():
self.handler = None
self.args = None
self.kwargs = None
def trigger(self):
"""
Triggers the whenable object, resulting in the handler being
@@ -305,7 +305,7 @@ def test_when_called_with_a_whenable():
"args": self.args,
"kwargs": self.kwargs,
}
self.handler(result) # call the handler
self.handler(result) # call the handler
def __when__(self, handler, *args, **kwargs):
"""
@@ -330,7 +330,7 @@ def test_when_called_with_a_whenable():
counter += 1
assert result["args"] == ("foo", "bar")
assert result["kwargs"] == {"baz": "qux"}
# When as a function.
web.when(whenable, handler, "foo", "bar", baz="qux")
@@ -340,4 +340,4 @@ def test_when_called_with_a_whenable():
whenable.trigger()
# The function should have been called when the whenable object was
# triggered.
assert counter == 1
assert counter == 1