Browse Source

Set max_line_length in .editorconfig to match flake8 config. (#7263)

* Set max_line_length in .editorconfig to match flake8 config.

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

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
pull/7267/head
Mads Jensen 7 months ago committed by GitHub
parent
commit
25ca389039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .editorconfig
  2. 3
      celery/__init__.py
  3. 3
      celery/app/__init__.py
  4. 11
      celery/app/base.py
  5. 3
      celery/app/log.py
  6. 3
      celery/app/task.py
  7. 7
      celery/app/trace.py
  8. 3
      celery/app/utils.py
  9. 3
      celery/apps/multi.py
  10. 3
      celery/backends/azureblockblob.py
  11. 16
      celery/backends/base.py
  12. 3
      celery/backends/cosmosdbsql.py
  13. 3
      celery/backends/redis.py
  14. 3
      celery/bin/beat.py
  15. 3
      celery/bin/call.py
  16. 3
      celery/bin/control.py
  17. 3
      celery/bin/events.py
  18. 3
      celery/bin/migrate.py
  19. 3
      celery/bin/purge.py
  20. 3
      celery/bin/result.py
  21. 3
      celery/bin/shell.py
  22. 3
      celery/bin/upgrade.py
  23. 6
      celery/bin/worker.py
  24. 3
      celery/canvas.py
  25. 3
      celery/exceptions.py
  26. 3
      celery/loaders/base.py
  27. 4
      celery/schedules.py
  28. 3
      celery/security/__init__.py
  29. 3
      celery/utils/collections.py
  30. 3
      celery/utils/functional.py
  31. 3
      celery/utils/saferepr.py
  32. 6
      celery/worker/consumer/consumer.py
  33. 3
      celery/worker/request.py
  34. 3
      celery/worker/worker.py
  35. 3
      examples/celery_http_gateway/urls.py
  36. 18
      t/integration/test_canvas.py
  37. 6
      t/integration/test_tasks.py
  38. 5
      t/unit/app/test_defaults.py
  39. 3
      t/unit/app/test_log.py
  40. 3
      t/unit/app/test_schedules.py
  41. 3
      t/unit/apps/test_multi.py
  42. 6
      t/unit/backends/test_base.py
  43. 6
      t/unit/backends/test_database.py
  44. 3
      t/unit/backends/test_redis.py
  45. 4
      t/unit/concurrency/test_prefork.py
  46. 6
      t/unit/conftest.py
  47. 9
      t/unit/contrib/test_migrate.py
  48. 3
      t/unit/events/test_state.py
  49. 3
      t/unit/fixups/test_django.py
  50. 5
      t/unit/tasks/test_canvas.py
  51. 6
      t/unit/tasks/test_result.py
  52. 12
      t/unit/tasks/test_trace.py
  53. 5
      t/unit/utils/test_collections.py
  54. 6
      t/unit/utils/test_functional.py
  55. 3
      t/unit/utils/test_imports.py
  56. 14
      t/unit/utils/test_platforms.py
  57. 7
      t/unit/utils/test_serialization.py
  58. 3
      t/unit/utils/test_text.py
  59. 3
      t/unit/utils/test_threads.py
  60. 9
      t/unit/utils/test_time.py
  61. 3
      t/unit/worker/test_consumer.py
  62. 3
      t/unit/worker/test_loops.py
  63. 9
      t/unit/worker/test_request.py
  64. 3
      t/unit/worker/test_worker.py

2
.editorconfig

@ -9,7 +9,7 @@ trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf
max_line_length = 78
max_line_length = 117
[Makefile]
indent_style = tab

3
celery/__init__.py

@ -70,8 +70,7 @@ if STATICA_HACK: # pragma: no cover
from celery.app.base import Celery
from celery.app.task import Task
from celery.app.utils import bugreport
from celery.canvas import (chain, chord, chunks, group, # noqa
maybe_signature, signature, subtask, xmap,
from celery.canvas import (chain, chord, chunks, group, maybe_signature, signature, subtask, xmap, # noqa
xstarmap)
from celery.utils import uuid

3
celery/app/__init__.py

@ -1,7 +1,6 @@
"""Celery Application."""
from celery import _state
from celery._state import (app_or_default, disable_trace, enable_trace,
pop_current_task, push_current_task)
from celery._state import app_or_default, disable_trace, enable_trace, pop_current_task, push_current_task
from celery.local import Proxy
from .base import Celery

11
celery/app/base.py

@ -18,10 +18,8 @@ from kombu.utils.uuid import uuid
from vine import starpromise
from celery import platforms, signals
from celery._state import (_announce_app_finalized, _deregister_app,
_register_app, _set_current_app, _task_stack,
connect_on_app_finalize, get_current_app,
get_current_worker_task, set_default_app)
from celery._state import (_announce_app_finalized, _deregister_app, _register_app, _set_current_app, _task_stack,
connect_on_app_finalize, get_current_app, get_current_worker_task, set_default_app)
from celery.exceptions import AlwaysEagerIgnored, ImproperlyConfigured
from celery.loaders import get_loader_cls
from celery.local import PromiseProxy, maybe_evaluate
@ -41,9 +39,8 @@ from .annotations import prepare as prepare_annotations
from .autoretry import add_autoretry_behaviour
from .defaults import DEFAULT_SECURITY_DIGEST, find_deprecated_settings
from .registry import TaskRegistry
from .utils import (AppPickler, Settings, _new_key_to_old, _old_key_to_new,
_unpickle_app, _unpickle_app_v2, appstr, bugreport,
detect_settings)
from .utils import (AppPickler, Settings, _new_key_to_old, _old_key_to_new, _unpickle_app, _unpickle_app_v2, appstr,
bugreport, detect_settings)
__all__ = ('Celery',)

3
celery/app/log.py

@ -19,8 +19,7 @@ from celery._state import get_current_task
from celery.exceptions import CDeprecationWarning, CPendingDeprecationWarning
from celery.local import class_property
from celery.platforms import isatty
from celery.utils.log import (ColorFormatter, LoggingProxy, get_logger,
get_multiprocessing_logger, mlevel,
from celery.utils.log import (ColorFormatter, LoggingProxy, get_logger, get_multiprocessing_logger, mlevel,
reset_multiprocessing_logger)
from celery.utils.nodenames import node_format
from celery.utils.term import colored

3
celery/app/task.py

@ -9,8 +9,7 @@ from kombu.utils.uuid import uuid
from celery import current_app, states
from celery._state import _task_stack
from celery.canvas import _chain, group, signature
from celery.exceptions import (Ignore, ImproperlyConfigured,
MaxRetriesExceededError, Reject, Retry)
from celery.exceptions import Ignore, ImproperlyConfigured, MaxRetriesExceededError, Reject, Retry
from celery.local import class_property
from celery.result import EagerResult, denied_join_result
from celery.utils import abstract

7
celery/app/trace.py

@ -20,16 +20,13 @@ from celery import current_app, group, signals, states
from celery._state import _task_stack
from celery.app.task import Context
from celery.app.task import Task as BaseTask
from celery.exceptions import (BackendGetMetaError, Ignore, InvalidTaskError,
Reject, Retry)
from celery.exceptions import BackendGetMetaError, Ignore, InvalidTaskError, Reject, Retry
from celery.result import AsyncResult
from celery.utils.log import get_logger
from celery.utils.nodenames import gethostname
from celery.utils.objects import mro_lookup
from celery.utils.saferepr import saferepr
from celery.utils.serialization import (get_pickleable_etype,
get_pickleable_exception,
get_pickled_exception)
from celery.utils.serialization import get_pickleable_etype, get_pickleable_exception, get_pickled_exception
# ## ---
# This is the heart of the worker, the inner loop so to speak.

3
celery/app/utils.py

@ -15,8 +15,7 @@ from celery.utils.collections import ConfigurationView
from celery.utils.imports import import_from_cwd, qualname, symbol_by_name
from celery.utils.text import pretty
from .defaults import (_OLD_DEFAULTS, _OLD_SETTING_KEYS, _TO_NEW_KEY,
_TO_OLD_KEY, DEFAULTS, SETTING_KEYS, find)
from .defaults import _OLD_DEFAULTS, _OLD_SETTING_KEYS, _TO_NEW_KEY, _TO_OLD_KEY, DEFAULTS, SETTING_KEYS, find
__all__ = (
'Settings', 'appstr', 'bugreport',

3
celery/apps/multi.py

@ -13,8 +13,7 @@ from kombu.utils.encoding import from_utf8
from kombu.utils.objects import cached_property
from celery.platforms import IS_WINDOWS, Pidfile, signal_name
from celery.utils.nodenames import (gethostname, host_format, node_format,
nodesplit)
from celery.utils.nodenames import gethostname, host_format, node_format, nodesplit
from celery.utils.saferepr import saferepr
__all__ = ('Cluster', 'Node')

3
celery/backends/azureblockblob.py

@ -9,8 +9,7 @@ from .base import KeyValueStoreBackend
try:
import azure.storage.blob as azurestorage
from azure.core.exceptions import (ResourceExistsError,
ResourceNotFoundError)
from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError
from azure.storage.blob import BlobServiceClient
except ImportError:
azurestorage = None

16
celery/backends/base.py

@ -23,20 +23,14 @@ import celery.exceptions
from celery import current_app, group, maybe_signature, states
from celery._state import get_current_task
from celery.app.task import Context
from celery.exceptions import (BackendGetMetaError, BackendStoreError,
ChordError, ImproperlyConfigured,
NotRegistered, SecurityError, TaskRevokedError,
TimeoutError)
from celery.result import (GroupResult, ResultBase, ResultSet,
allow_join_result, result_from_tuple)
from celery.exceptions import (BackendGetMetaError, BackendStoreError, ChordError, ImproperlyConfigured,
NotRegistered, SecurityError, TaskRevokedError, TimeoutError)
from celery.result import GroupResult, ResultBase, ResultSet, allow_join_result, result_from_tuple
from celery.utils.collections import BufferMap
from celery.utils.functional import LRUCache, arity_greater
from celery.utils.log import get_logger
from celery.utils.serialization import (create_exception_cls,
ensure_serializable,
get_pickleable_exception,
get_pickled_exception,
raise_with_context)
from celery.utils.serialization import (create_exception_cls, ensure_serializable, get_pickleable_exception,
get_pickled_exception, raise_with_context)
from celery.utils.time import get_exponential_backoff_interval
__all__ = ('BaseBackend', 'KeyValueStoreBackend', 'DisabledBackend')

3
celery/backends/cosmosdbsql.py

@ -11,8 +11,7 @@ from .base import KeyValueStoreBackend
try:
import pydocumentdb
from pydocumentdb.document_client import DocumentClient
from pydocumentdb.documents import (ConnectionPolicy, ConsistencyLevel,
PartitionKind)
from pydocumentdb.documents import ConnectionPolicy, ConsistencyLevel, PartitionKind
from pydocumentdb.errors import HTTPFailure
from pydocumentdb.retry_options import RetryOptions
except ImportError: # pragma: no cover

3
celery/backends/redis.py

@ -12,8 +12,7 @@ from kombu.utils.url import _parse_url, maybe_sanitize_url
from celery import states
from celery._state import task_join_will_block
from celery.canvas import maybe_signature
from celery.exceptions import (BackendStoreError, ChordError,
ImproperlyConfigured)
from celery.exceptions import BackendStoreError, ChordError, ImproperlyConfigured
from celery.result import GroupResult, allow_join_result
from celery.utils.functional import _regen, dictfilter
from celery.utils.log import get_logger

3
celery/bin/beat.py

@ -3,8 +3,7 @@ from functools import partial
import click
from celery.bin.base import (LOG_LEVEL, CeleryDaemonCommand, CeleryOption,
handle_preload_options)
from celery.bin.base import LOG_LEVEL, CeleryDaemonCommand, CeleryOption, handle_preload_options
from celery.platforms import detached, maybe_drop_privileges

3
celery/bin/call.py

@ -1,8 +1,7 @@
"""The ``celery call`` program used to send tasks from the command-line."""
import click
from celery.bin.base import (ISO8601, ISO8601_OR_FLOAT, JSON_ARRAY,
JSON_OBJECT, CeleryCommand, CeleryOption,
from celery.bin.base import (ISO8601, ISO8601_OR_FLOAT, JSON_ARRAY, JSON_OBJECT, CeleryCommand, CeleryOption,
handle_preload_options)

3
celery/bin/control.py

@ -4,8 +4,7 @@ from functools import partial
import click
from kombu.utils.json import dumps
from celery.bin.base import (COMMA_SEPARATED_LIST, CeleryCommand,
CeleryOption, handle_preload_options)
from celery.bin.base import COMMA_SEPARATED_LIST, CeleryCommand, CeleryOption, handle_preload_options
from celery.exceptions import CeleryCommandException
from celery.platforms import EX_UNAVAILABLE
from celery.utils import text

3
celery/bin/events.py

@ -4,8 +4,7 @@ from functools import partial
import click
from celery.bin.base import (LOG_LEVEL, CeleryDaemonCommand, CeleryOption,
handle_preload_options)
from celery.bin.base import LOG_LEVEL, CeleryDaemonCommand, CeleryOption, handle_preload_options
from celery.platforms import detached, set_process_title, strargv

3
celery/bin/migrate.py

@ -2,8 +2,7 @@
import click
from kombu import Connection
from celery.bin.base import (CeleryCommand, CeleryOption,
handle_preload_options)
from celery.bin.base import CeleryCommand, CeleryOption, handle_preload_options
from celery.contrib.migrate import migrate_tasks

3
celery/bin/purge.py

@ -1,8 +1,7 @@
"""The ``celery purge`` program, used to delete messages from queues."""
import click
from celery.bin.base import (COMMA_SEPARATED_LIST, CeleryCommand,
CeleryOption, handle_preload_options)
from celery.bin.base import COMMA_SEPARATED_LIST, CeleryCommand, CeleryOption, handle_preload_options
from celery.utils import text

3
celery/bin/result.py

@ -1,8 +1,7 @@
"""The ``celery result`` program, used to inspect task results."""
import click
from celery.bin.base import (CeleryCommand, CeleryOption,
handle_preload_options)
from celery.bin.base import CeleryCommand, CeleryOption, handle_preload_options
@click.command(cls=CeleryCommand)

3
celery/bin/shell.py

@ -6,8 +6,7 @@ from importlib import import_module
import click
from celery.bin.base import (CeleryCommand, CeleryOption,
handle_preload_options)
from celery.bin.base import CeleryCommand, CeleryOption, handle_preload_options
def _invoke_fallback_shell(locals):

3
celery/bin/upgrade.py

@ -5,8 +5,7 @@ import sys
import click
from celery.app import defaults
from celery.bin.base import (CeleryCommand, CeleryOption,
handle_preload_options)
from celery.bin.base import CeleryCommand, CeleryOption, handle_preload_options
from celery.utils.functional import pass1

6
celery/bin/worker.py

@ -8,13 +8,11 @@ from click import ParamType
from click.types import StringParamType
from celery import concurrency
from celery.bin.base import (COMMA_SEPARATED_LIST, LOG_LEVEL,
CeleryDaemonCommand, CeleryOption,
from celery.bin.base import (COMMA_SEPARATED_LIST, LOG_LEVEL, CeleryDaemonCommand, CeleryOption,
handle_preload_options)
from celery.concurrency.base import BasePool
from celery.exceptions import SecurityError
from celery.platforms import (EX_FAILURE, EX_OK, detached,
maybe_drop_privileges)
from celery.platforms import EX_FAILURE, EX_OK, detached, maybe_drop_privileges
from celery.utils.log import get_logger
from celery.utils.nodenames import default_nodename, host_format, node_format

3
celery/canvas.py

@ -26,8 +26,7 @@ from celery.utils import abstract
from celery.utils.collections import ChainMap
from celery.utils.functional import _regen
from celery.utils.functional import chunks as _chunks
from celery.utils.functional import (is_list, lookahead, maybe_list, regen,
seq_concat_item, seq_concat_seq)
from celery.utils.functional import is_list, lookahead, maybe_list, regen, seq_concat_item, seq_concat_seq
from celery.utils.objects import getitem_property
from celery.utils.text import remove_repeating_from_task, truncate

3
celery/exceptions.py

@ -53,8 +53,7 @@ Error Hierarchy
import numbers
from billiard.exceptions import (SoftTimeLimitExceeded, Terminated,
TimeLimitExceeded, WorkerLostError)
from billiard.exceptions import SoftTimeLimitExceeded, Terminated, TimeLimitExceeded, WorkerLostError
from click import ClickException
from kombu.exceptions import OperationalError

3
celery/loaders/base.py

@ -12,8 +12,7 @@ from celery import signals
from celery.exceptions import reraise
from celery.utils.collections import DictAttribute, force_mapping
from celery.utils.functional import maybe_list
from celery.utils.imports import (NotAPackage, find_module, import_from_cwd,
symbol_by_name)
from celery.utils.imports import NotAPackage, find_module, import_from_cwd, symbol_by_name
__all__ = ('BaseLoader',)

4
celery/schedules.py

@ -11,8 +11,8 @@ from kombu.utils.objects import cached_property
from . import current_app
from .utils.collections import AttributeDict
from .utils.time import (ffwd, humanize_seconds, localize, maybe_make_aware,
maybe_timedelta, remaining, timezone, weekday)
from .utils.time import (ffwd, humanize_seconds, localize, maybe_make_aware, maybe_timedelta, remaining, timezone,
weekday)
__all__ = (
'ParseException', 'schedule', 'crontab', 'crontab_parser',

3
celery/security/__init__.py

@ -1,6 +1,5 @@
"""Message Signing Serializer."""
from kombu.serialization import \
disable_insecure_serializers as _disable_insecure_serializers
from kombu.serialization import disable_insecure_serializers as _disable_insecure_serializers
from kombu.serialization import registry
from celery.exceptions import ImproperlyConfigured

3
celery/utils/collections.py

@ -2,8 +2,7 @@
import time
from collections import OrderedDict as _OrderedDict
from collections import deque
from collections.abc import (Callable, Mapping, MutableMapping, MutableSet,
Sequence)
from collections.abc import Callable, Mapping, MutableMapping, MutableSet, Sequence
from heapq import heapify, heappop, heappush
from itertools import chain, count
from queue import Empty

3
celery/utils/functional.py

@ -5,8 +5,7 @@ from collections import UserList
from functools import partial
from itertools import islice, tee, zip_longest
from kombu.utils.functional import (LRUCache, dictfilter, is_list, lazy,
maybe_evaluate, maybe_list, memoize)
from kombu.utils.functional import LRUCache, dictfilter, is_list, lazy, maybe_evaluate, maybe_list, memoize
from vine import promise
__all__ = (

3
celery/utils/saferepr.py

@ -15,8 +15,7 @@ from decimal import Decimal
from itertools import chain
from numbers import Number
from pprint import _recursion
from typing import (Any, AnyStr, Callable, Dict, Iterator, List, Sequence,
Set, Tuple)
from typing import Any, AnyStr, Callable, Dict, Iterator, List, Sequence, Set, Tuple
from .text import truncate

6
celery/worker/consumer/consumer.py

@ -22,8 +22,7 @@ from vine import ppartial, promise
from celery import bootsteps, signals
from celery.app.trace import build_tracer
from celery.exceptions import (CPendingDeprecationWarning, InvalidTaskError,
NotRegistered)
from celery.exceptions import CPendingDeprecationWarning, InvalidTaskError, NotRegistered
from celery.utils.functional import noop
from celery.utils.log import get_logger
from celery.utils.nodenames import gethostname
@ -31,8 +30,7 @@ from celery.utils.objects import Bunch
from celery.utils.text import truncate
from celery.utils.time import humanize_seconds, rate
from celery.worker import loops
from celery.worker.state import (active_requests, maybe_shutdown,
reserved_requests, task_reserved)
from celery.worker.state import active_requests, maybe_shutdown, reserved_requests, task_reserved
__all__ = ('Consumer', 'Evloop', 'dump_body')

3
celery/worker/request.py

@ -16,8 +16,7 @@ from kombu.utils.objects import cached_property
from celery import current_app, signals
from celery.app.task import Context
from celery.app.trace import fast_trace_task, trace_task, trace_task_ret
from celery.exceptions import (Ignore, InvalidTaskError, Reject, Retry,
TaskRevokedError, Terminated,
from celery.exceptions import (Ignore, InvalidTaskError, Reject, Retry, TaskRevokedError, Terminated,
TimeLimitExceeded, WorkerLostError)
from celery.platforms import signals as _signals
from celery.utils.functional import maybe, noop

3
celery/worker/worker.py

@ -23,8 +23,7 @@ from celery import bootsteps
from celery import concurrency as _concurrency
from celery import signals
from celery.bootsteps import RUN, TERMINATE
from celery.exceptions import (ImproperlyConfigured, TaskRevokedError,
WorkerTerminate)
from celery.exceptions import ImproperlyConfigured, TaskRevokedError, WorkerTerminate
from celery.platforms import EX_FAILURE, create_pidlock
from celery.utils.imports import reload_from_cwd
from celery.utils.log import mlevel

3
examples/celery_http_gateway/urls.py

@ -1,6 +1,5 @@
from celery_http_gateway.tasks import hello_world
from django.conf.urls.defaults import (handler404, handler500, # noqa
include, patterns, url)
from django.conf.urls.defaults import handler404, handler500, include, patterns, url # noqa
from djcelery import views as celery_views
# Uncomment the next two lines to enable the admin:

18
t/integration/test_canvas.py

@ -14,17 +14,13 @@ from celery.exceptions import ImproperlyConfigured, TimeoutError
from celery.result import AsyncResult, GroupResult, ResultSet
from . import tasks
from .conftest import (TEST_BACKEND, get_active_redis_channels,
get_redis_connection)
from .tasks import (ExpectedException, add, add_chord_to_chord, add_replaced,
add_to_all, add_to_all_to_chord, build_chain_inside_task,
collect_ids, delayed_sum, delayed_sum_with_soft_guard,
errback_new_style, errback_old_style, fail, fail_replaced,
identity, ids, print_unicode, raise_error, redis_count,
redis_echo, replace_with_chain,
replace_with_chain_which_raises, replace_with_empty_chain,
retry_once, return_exception, return_priority,
second_order_replace1, tsum, write_to_file_and_return_int)
from .conftest import TEST_BACKEND, get_active_redis_channels, get_redis_connection
from .tasks import (ExpectedException, add, add_chord_to_chord, add_replaced, add_to_all, add_to_all_to_chord,
build_chain_inside_task, collect_ids, delayed_sum, delayed_sum_with_soft_guard,
errback_new_style, errback_old_style, fail, fail_replaced, identity, ids, print_unicode,
raise_error, redis_count, redis_echo, replace_with_chain, replace_with_chain_which_raises,
replace_with_empty_chain, retry_once, return_exception, return_priority, second_order_replace1,
tsum, write_to_file_and_return_int)
RETRYABLE_EXCEPTIONS = (OSError, ConnectionError, TimeoutError)

6
t/integration/test_tasks.py

@ -7,10 +7,8 @@ import celery
from celery import group
from .conftest import get_active_redis_channels
from .tasks import (ClassBasedAutoRetryTask, ExpectedException, add,
add_ignore_result, add_not_typed, fail, print_unicode,
retry, retry_once, retry_once_priority, return_properties,
sleeping)
from .tasks import (ClassBasedAutoRetryTask, ExpectedException, add, add_ignore_result, add_not_typed, fail,
print_unicode, retry, retry_once, retry_once_priority, return_properties, sleeping)
TIMEOUT = 10

5
t/unit/app/test_defaults.py

@ -1,9 +1,8 @@
import sys
from importlib import import_module
from celery.app.defaults import (_OLD_DEFAULTS, _OLD_SETTING_KEYS,
_TO_NEW_KEY, _TO_OLD_KEY, DEFAULTS,
NAMESPACES, SETTING_KEYS)
from celery.app.defaults import (_OLD_DEFAULTS, _OLD_SETTING_KEYS, _TO_NEW_KEY, _TO_OLD_KEY, DEFAULTS, NAMESPACES,
SETTING_KEYS)
class test_defaults:

3
t/unit/app/test_log.py

@ -9,8 +9,7 @@ import pytest
from celery import signals, uuid
from celery.app.log import TaskFormatter
from celery.utils.log import (ColorFormatter, LoggingProxy, get_logger,
get_task_logger, in_sighandler)
from celery.utils.log import ColorFormatter, LoggingProxy, get_logger, get_task_logger, in_sighandler
from celery.utils.log import logger as base_logger
from celery.utils.log import logger_isa, task_logger
from t.unit import conftest

3
t/unit/app/test_schedules.py

@ -8,8 +8,7 @@ from unittest.mock import Mock
import pytest
import pytz
from celery.schedules import (ParseException, crontab, crontab_parser,
schedule, solar)
from celery.schedules import ParseException, crontab, crontab_parser, schedule, solar
assertions = TestCase('__init__')

3
t/unit/apps/test_multi.py

@ -7,8 +7,7 @@ from unittest.mock import Mock, call, patch
import pytest
import t.skip
from celery.apps.multi import (Cluster, MultiParser, NamespacedOptionParser,
Node, format_opt)
from celery.apps.multi import Cluster, MultiParser, NamespacedOptionParser, Node, format_opt
class test_functions:

6
t/unit/backends/test_base.py

@ -9,10 +9,8 @@ from kombu.utils.encoding import ensure_bytes
import celery
from celery import chord, group, signature, states, uuid
from celery.app.task import Context, Task
from celery.backends.base import (BaseBackend, DisabledBackend,
KeyValueStoreBackend, _nulldict)
from celery.exceptions import (BackendGetMetaError, BackendStoreError,
ChordError, SecurityError, TimeoutError)
from celery.backends.base import BaseBackend, DisabledBackend, KeyValueStoreBackend, _nulldict
from celery.exceptions import BackendGetMetaError, BackendStoreError, ChordError, SecurityError, TimeoutError
from celery.result import result_from_tuple
from celery.utils import serialization
from celery.utils.functional import pass1

6
t/unit/backends/test_database.py

@ -10,11 +10,9 @@ from celery.exceptions import ImproperlyConfigured
pytest.importorskip('sqlalchemy')
from celery.backends.database import (DatabaseBackend, retry, session, # noqa
session_cleanup)
from celery.backends.database import DatabaseBackend, retry, session, session_cleanup # noqa
from celery.backends.database.models import Task, TaskSet # noqa
from celery.backends.database.session import ( # noqa
PREPARE_MODELS_MAX_RETRIES, ResultModelBase, SessionManager)
from celery.backends.database.session import PREPARE_MODELS_MAX_RETRIES, ResultModelBase, SessionManager # noqa
from t import skip # noqa

3
t/unit/backends/test_redis.py

@ -12,8 +12,7 @@ import pytest
from celery import signature, states, uuid
from celery.canvas import Signature
from celery.contrib.testing.mocks import ContextMock
from celery.exceptions import (BackendStoreError, ChordError,
ImproperlyConfigured)
from celery.exceptions import BackendStoreError, ChordError, ImproperlyConfigured
from celery.result import AsyncResult, GroupResult
from celery.utils.collections import AttributeDict
from t.unit import conftest

4
t/unit/concurrency/test_prefork.py

@ -66,9 +66,7 @@ class test_process_initializer:
def test_process_initializer(self, _signals, set_mp_process_title, restore_logging):
from celery import signals
from celery._state import _tls
from celery.concurrency.prefork import (WORKER_SIGIGNORE,
WORKER_SIGRESET,
process_initializer)
from celery.concurrency.prefork import WORKER_SIGIGNORE, WORKER_SIGRESET, process_initializer
on_worker_process_init = Mock()
signals.worker_process_init.connect(on_worker_process_init)

6
t/unit/conftest.py

@ -20,11 +20,9 @@ from celery.backends.cache import CacheBackend, DummyClient
# we have to import the pytest plugin fixtures here,
# in case user did not do the `python setup.py develop` yet,
# that installs the pytest plugin into the setuptools registry.
from celery.contrib.pytest import (celery_app, celery_enable_logging,
celery_parameters, depends_on_current_app)
from celery.contrib.pytest import celery_app, celery_enable_logging, celery_parameters, depends_on_current_app
from celery.contrib.testing.app import TestApp, Trap
from celery.contrib.testing.mocks import (TaskMessage, TaskMessage1,
task_message_from_sig)
from celery.contrib.testing.mocks import TaskMessage, TaskMessage1, task_message_from_sig
# Tricks flake8 into silencing redefining fixtures warnings.
__all__ = (

9
t/unit/contrib/test_migrate.py

@ -7,12 +7,9 @@ from kombu import Connection, Exchange, Producer, Queue
from kombu.transport.virtual import QoS
from kombu.utils.encoding import ensure_bytes
from celery.contrib.migrate import (State, StopFiltering, _maybe_queue,
expand_dest, filter_callback,
filter_status, migrate_task,
migrate_tasks, move, move_by_idmap,
move_by_taskmap, move_task_by_id,
start_filter, task_id_eq, task_id_in)
from celery.contrib.migrate import (State, StopFiltering, _maybe_queue, expand_dest, filter_callback, filter_status,
migrate_task, migrate_tasks, move, move_by_idmap, move_by_taskmap,
move_task_by_id, start_filter, task_id_eq, task_id_in)
from t.unit import conftest
# hack to ignore error at shutdown

3
t/unit/events/test_state.py

@ -9,8 +9,7 @@ import pytest
from celery import states, uuid
from celery.events import Event
from celery.events.state import (HEARTBEAT_DRIFT_MAX, HEARTBEAT_EXPIRE_WINDOW,
State, Task, Worker, heartbeat_expires)
from celery.events.state import HEARTBEAT_DRIFT_MAX, HEARTBEAT_EXPIRE_WINDOW, State, Task, Worker, heartbeat_expires
class replay:

3
t/unit/fixups/test_django.py

@ -3,8 +3,7 @@ from unittest.mock import Mock, patch
import pytest
from celery.fixups.django import (DjangoFixup, DjangoWorkerFixup,
FixupWarning, _maybe_close_fd, fixup)
from celery.fixups.django import DjangoFixup, DjangoWorkerFixup, FixupWarning, _maybe_close_fd, fixup
from t.unit import conftest

5
t/unit/tasks/test_canvas.py

@ -5,9 +5,8 @@ import pytest
import pytest_subtests # noqa: F401
from celery._state import _task_stack
from celery.canvas import (Signature, _chain, _maybe_group, chain, chord,
chunks, group, maybe_signature, maybe_unroll_group,
signature, xmap, xstarmap)
from celery.canvas import (Signature, _chain, _maybe_group, chain, chord, chunks, group, maybe_signature,
maybe_unroll_group, signature, xmap, xstarmap)
from celery.result import AsyncResult, EagerResult, GroupResult
SIG = Signature({

6
t/unit/tasks/test_result.py

@ -9,10 +9,8 @@ import pytest
from celery import states, uuid
from celery.app.task import Context
from celery.backends.base import SyncBackendMixin
from celery.exceptions import (ImproperlyConfigured, IncompleteStream,
TimeoutError)
from celery.result import (AsyncResult, EagerResult, GroupResult, ResultSet,
assert_will_not_block, result_from_tuple)
from celery.exceptions import ImproperlyConfigured, IncompleteStream, TimeoutError
from celery.result import AsyncResult, EagerResult, GroupResult, ResultSet, assert_will_not_block, result_from_tuple
from celery.utils.serialization import pickle
PYTRACEBACK = """\

12
t/unit/tasks/test_trace.py

@ -7,14 +7,10 @@ from kombu.exceptions import EncodeError
from celery import group, signals, states, uuid
from celery.app.task import Context
from celery.app.trace import (TraceInfo, build_tracer, fast_trace_task,
get_log_policy, get_task_name,
log_policy_expected, log_policy_ignore,
log_policy_internal, log_policy_reject,
log_policy_unexpected,
reset_worker_optimizations,
setup_worker_optimizations, trace_task,
trace_task_ret, traceback_clear)
from celery.app.trace import (TraceInfo, build_tracer, fast_trace_task, get_log_policy, get_task_name,
log_policy_expected, log_policy_ignore, log_policy_internal, log_policy_reject,
log_policy_unexpected, reset_worker_optimizations, setup_worker_optimizations,
trace_task, trace_task_ret, traceback_clear)
from celery.backends.base import BaseDictBackend
from celery.backends.cache import CacheBackend
from celery.exceptions import BackendGetMetaError, Ignore, Reject, Retry

5
t/unit/utils/test_collections.py

@ -7,9 +7,8 @@ import pytest
from billiard.einfo import ExceptionInfo
import t.skip
from celery.utils.collections import (AttributeDict, BufferMap,
ConfigurationView, DictAttribute,
LimitedSet, Messagebuffer)
from celery.utils.collections import (AttributeDict, BufferMap, ConfigurationView, DictAttribute, LimitedSet,
Messagebuffer)
from celery.utils.objects import Bunch

6
t/unit/utils/test_functional.py

@ -4,10 +4,8 @@ import pytest
import pytest_subtests # noqa: F401
from kombu.utils.functional import lazy
from celery.utils.functional import (DummyContext, first, firstmethod,
fun_accepts_kwargs, fun_takes_argument,
head_from_fun, lookahead, maybe_list,
mlazy, padlist, regen, seq_concat_item,
from celery.utils.functional import (DummyContext, first, firstmethod, fun_accepts_kwargs, fun_takes_argument,
head_from_fun, lookahead, maybe_list, mlazy, padlist, regen, seq_concat_item,
seq_concat_seq)

3
t/unit/utils/test_imports.py

@ -3,8 +3,7 @@ from unittest.mock import Mock, patch
import pytest
from celery.utils.imports import (NotAPackage, find_module, gen_task_name,
module_file, qualname, reload_from_cwd)
from celery.utils.imports import NotAPackage, find_module, gen_task_name, module_file, qualname, reload_from_cwd
def test_find_module():

14
t/unit/utils/test_platforms.py

@ -11,15 +11,11 @@ import pytest
import t.skip
from celery import _find_option_with_arg, platforms
from celery.exceptions import SecurityError, SecurityWarning
from celery.platforms import (ASSUMING_ROOT, ROOT_DISALLOWED,
ROOT_DISCOURAGED, DaemonContext, LockFailed,
Pidfile, _setgroups_hack, check_privileges,
close_open_fds, create_pidlock, detached,
fd_by_path, get_fdmax, ignore_errno, initgroups,
isatty, maybe_drop_privileges, parse_gid,
parse_uid, set_mp_process_title, set_pdeathsig,
set_process_title, setgid, setgroups, setuid,
signals)
from celery.platforms import (ASSUMING_ROOT, ROOT_DISALLOWED, ROOT_DISCOURAGED, DaemonContext, LockFailed, Pidfile,
_setgroups_hack, check_privileges, close_open_fds, create_pidlock, detached,
fd_by_path, get_fdmax, ignore_errno, initgroups, isatty, maybe_drop_privileges,
parse_gid, parse_uid, set_mp_process_title, set_pdeathsig, set_process_title, setgid,
setgroups, setuid, signals)
from celery.utils.text import WhateverIO
from t.unit import conftest

7
t/unit/utils/test_serialization.py

@ -8,11 +8,8 @@ import pytest
import pytz
from kombu import Queue
from celery.utils.serialization import (STRTOBOOL_DEFAULT_TABLE,
UnpickleableExceptionWrapper,
ensure_serializable,
get_pickleable_etype, jsonify,
strtobool)
from celery.utils.serialization import (STRTOBOOL_DEFAULT_TABLE, UnpickleableExceptionWrapper, ensure_serializable,
get_pickleable_etype, jsonify, strtobool)
class test_AAPickle:

3
t/unit/utils/test_text.py

@ -1,7 +1,6 @@
import pytest
from celery.utils.text import (abbr, abbrtask, ensure_newlines, indent,
pretty, truncate)
from celery.utils.text import abbr, abbrtask, ensure_newlines, indent, pretty, truncate
RANDTEXT = """\
The quick brown

3
t/unit/utils/test_threads.py

@ -2,8 +2,7 @@ from unittest.mock import patch
import pytest
from celery.utils.threads import (Local, LocalManager, _FastLocalStack,
_LocalStack, bgThread)
from celery.utils.threads import Local, LocalManager, _FastLocalStack, _LocalStack, bgThread
from t.unit import conftest

9
t/unit/utils/test_time.py

@ -6,12 +6,9 @@ import pytz
from pytz import AmbiguousTimeError
from celery.utils.iso8601 import parse_iso8601
from celery.utils.time import (LocalTimezone, delta_resolution, ffwd,
get_exponential_backoff_interval,
humanize_seconds, localize, make_aware,
maybe_iso8601, maybe_make_aware,
maybe_timedelta, rate, remaining, timezone,
utcoffset)
from celery.utils.time import (LocalTimezone, delta_resolution, ffwd, get_exponential_backoff_interval,
humanize_seconds, localize, make_aware, maybe_iso8601, maybe_make_aware,
maybe_timedelta, rate, remaining, timezone, utcoffset)
class test_LocalTimezone:

3
t/unit/worker/test_consumer.py

@ -9,8 +9,7 @@ from billiard.exceptions import RestartFreqExceeded
from celery.contrib.testing.mocks import ContextMock
from celery.utils.collections import LimitedSet
from celery.worker.consumer.agent import Agent
from celery.worker.consumer.consumer import (CANCEL_TASKS_BY_DEFAULT, CLOSE,
TERMINATE, Consumer)
from celery.worker.consumer.consumer import CANCEL_TASKS_BY_DEFAULT, CLOSE, TERMINATE, Consumer
from celery.worker.consumer.gossip import Gossip
from celery.worker.consumer.heart import Heart
from celery.worker.consumer.mingle import Mingle

3
t/unit/worker/test_loops.py

@ -8,8 +8,7 @@ from kombu.asynchronous import ERR, READ, WRITE, Hub
from kombu.exceptions import DecodeError
from celery.bootsteps import CLOSE, RUN
from celery.exceptions import (InvalidTaskError, WorkerLostError,
WorkerShutdown, WorkerTerminate)
from celery.exceptions import InvalidTaskError, WorkerLostError, WorkerShutdown, WorkerTerminate
from celery.platforms import EX_FAILURE, EX_OK
from celery.worker import state
from celery.worker.consumer import Consumer

9
t/unit/worker/test_request.py

@ -12,13 +12,10 @@ from kombu.utils.encoding import from_utf8, safe_repr, safe_str
from kombu.utils.uuid import uuid
from celery import states
from celery.app.trace import (TraceInfo, build_tracer, fast_trace_task,
mro_lookup, reset_worker_optimizations,
setup_worker_optimizations, trace_task,
trace_task_ret)
from celery.app.trace import (TraceInfo, build_tracer, fast_trace_task, mro_lookup, reset_worker_optimizations,
setup_worker_optimizations, trace_task, trace_task_ret)
from celery.backends.base import BaseDictBackend
from celery.exceptions import (Ignore, InvalidTaskError, Reject, Retry,
TaskRevokedError, Terminated, WorkerLostError)
from celery.exceptions import Ignore, InvalidTaskError, Reject, Retry, TaskRevokedError, Terminated, WorkerLostError
from celery.signals import task_failure, task_retry, task_revoked
from celery.worker import request as module
from celery.worker import strategy

3
t/unit/worker/test_worker.py

@ -21,8 +21,7 @@ from kombu.utils.uuid import uuid
import t.skip
from celery.bootsteps import CLOSE, RUN, TERMINATE, StartStopStep
from celery.concurrency.base import BasePool
from celery.exceptions import (ImproperlyConfigured, InvalidTaskError,
TaskRevokedError, WorkerShutdown,
from celery.exceptions import (ImproperlyConfigured, InvalidTaskError, TaskRevokedError, WorkerShutdown,
WorkerTerminate)
from celery.platforms import EX_FAILURE
from celery.utils.nodenames import worker_direct

Loading…
Cancel
Save