diff --git a/asynq/batching.py b/asynq/batching.py index ac08a3c..25d76fe 100644 --- a/asynq/batching.py +++ b/asynq/batching.py @@ -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), ) diff --git a/asynq/debug.py b/asynq/debug.py index 7402f6e..3335b34 100644 --- a/asynq/debug.py +++ b/asynq/debug.py @@ -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): diff --git a/asynq/tests/test_scoped_value.py b/asynq/tests/test_scoped_value.py index 78cc45e..58ba4bd 100644 --- a/asynq/tests/test_scoped_value.py +++ b/asynq/tests/test_scoped_value.py @@ -44,7 +44,6 @@ def async_scoped_value_caller(): def test_async_scoped_value(): - async_scoped_value_caller() val = AsyncScopedValue("capybara") diff --git a/asynq/tests/test_tools.py b/asynq/tests/test_tools.py index 45d03c0..ccd03a0 100644 --- a/asynq/tests/test_tools.py +++ b/asynq/tests/test_tools.py @@ -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): diff --git a/pyproject.toml b/pyproject.toml index 9cebef0..d5ca5f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ target_version = ['py36', 'py37', 'py38', 'py39'] include = '\.pyi?$' skip-magic-trailing-comma = true -experimental-string-processing = true +preview = true exclude = ''' /(