Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Oct 11, 2024
1 parent dcdd8d3 commit 45c303d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
26 changes: 12 additions & 14 deletions asynq/tests/test_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,20 @@ def _check_mock(cls, mock_fn, async_caller, non_async_caller):


def test_mock_async_context():
with asynq.mock.patch(
"asynq.tests.test_mock.fn"
) as mock_fn, asynq.mock.patch.object(
Cls, "async_classmethod"
) as mock_classmethod, asynq.mock.patch.object(
Cls, "async_method"
) as mock_method:
with (
asynq.mock.patch("asynq.tests.test_mock.fn") as mock_fn,
asynq.mock.patch.object(Cls, "async_classmethod") as mock_classmethod,
asynq.mock.patch.object(Cls, "async_method") as mock_method,
):
MockCheckerWithAssignment.check(mock_fn, mock_classmethod, mock_method)

with asynq.mock.patch(
"asynq.tests.test_mock.fn", lambda: 42
) as mock_fn, asynq.mock.patch.object(
Cls, "async_classmethod", classmethod(lambda _: 42)
) as mock_classmethod, asynq.mock.patch.object(
Cls, "async_method", lambda _: 42
) as mock_method:
with (
asynq.mock.patch("asynq.tests.test_mock.fn", lambda: 42) as mock_fn,
asynq.mock.patch.object(
Cls, "async_classmethod", classmethod(lambda _: 42)
) as mock_classmethod,
asynq.mock.patch.object(Cls, "async_method", lambda _: 42) as mock_method,
):
MockCheckerWithNew.check(mock_fn, mock_classmethod, mock_method)


Expand Down
5 changes: 3 additions & 2 deletions asynq/tests/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def test():
with Profiler("test_performance(3000): actual test (w/assertions)"):
performance_test(3000).value()
gc.collect()
with debug.disable_complex_assertions(), Profiler(
"test_performance(3000): actual test (w/o assertions)"
with (
debug.disable_complex_assertions(),
Profiler("test_performance(3000): actual test (w/o assertions)"),
):
performance_test(3000).value()

0 comments on commit 45c303d

Please sign in to comment.