Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed May 4, 2023
1 parent 393d94d commit cd8127a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
10 changes: 5 additions & 5 deletions asynq/batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ def _try_switch_active_batch(self):
def __str__(self):
return "%s (%s, %i items)" % (
core_inspection.get_full_name(type(self)),
"cancelled"
if self.is_cancelled()
else "flushed"
if self.is_flushed()
else "pending",
(
"cancelled"
if self.is_cancelled()
else "flushed" if self.is_flushed() else "pending"
),
len(self.items),
)

Expand Down
2 changes: 1 addition & 1 deletion asynq/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def filter_traceback(tb_list):
did_replacement = False
# for each replacement, try checking if all lines match
# if so, replace with the given replacement
for (text_to_match, replacement) in REPLACEMENTS:
for text_to_match, replacement in REPLACEMENTS:
matches = True
j = 0
while j < len(text_to_match) and (i + j) < len(tb_list):
Expand Down
1 change: 0 additions & 1 deletion asynq/tests/test_scoped_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def async_scoped_value_caller():


def test_async_scoped_value():

async_scoped_value_caller()

val = AsyncScopedValue("capybara")
Expand Down
4 changes: 1 addition & 3 deletions asynq/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,7 @@ def fn(foo, bar, baz=None, **kwargs):

decorated = aretry(Exception)(fn)

assert_eq(
inspect.signature(fn), inspect.signature(get_original_fn(decorated))
)
assert_eq(inspect.signature(fn), inspect.signature(get_original_fn(decorated)))


class Ctx(AsyncContext):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
target_version = ['py36', 'py37', 'py38', 'py39']
include = '\.pyi?$'
skip-magic-trailing-comma = true
experimental-string-processing = true
preview = true

exclude = '''
/(
Expand Down

0 comments on commit cd8127a

Please sign in to comment.