Skip to content

use unittest.mock instead of mock in tests #2611

@schoekek

Description

@schoekek

Describe the bug:
with 7241b27 your use unittest.mock instead of mock,
why this wasn't implemented consistently?

Could you please also adjust the tests?

To Reproduce
12:47 $ grep mock -r | grep import
tests/client/py3_exception_tests.py:import mock
tests/client/client_tests.py:import mock
tests/client/exception_tests.py:import mock
tests/events/tests.py:from mock import Mock
tests/config/central_config_tests.py:import mock
tests/config/tests.py:import mock
tests/contrib/django/wrapper_tests.py:import mock
tests/contrib/django/django_tests.py:import mock
tests/contrib/opentracing/tests.py:import mock
tests/contrib/flask/flask_tests.py:import mock
tests/contrib/celery/flask_tests.py:import mock
tests/contrib/serverless/azurefunctions/azure_functions_tests.py:import mock
tests/contrib/asyncio/starlette_tests.py:import mock
tests/contrib/asyncio/aiohttp_web_tests.py:import mock
tests/contrib/asyncio/tornado/tornado_tests.py:import mock
tests/transports/test_urllib3.py:import mock
tests/transports/test_base.py:import mock
tests/processors/tests.py:import mock
tests/fixtures.py:import mock
tests/metrics/base_tests.py:import mock
tests/metrics/breakdown_tests.py:import mock
tests/instrumentation/transactions_store_tests.py:import mock
tests/instrumentation/elasticsearch_tests.py:from unittest import mock
tests/instrumentation/base_tests.py:import mock
tests/instrumentation/urllib_tests.py:import mock
tests/utils/threading_tests.py:import mock
tests/utils/compat_tests.py:import mock
tests/utils/cloud_tests.py:import mock
tests/utils/stacks/tests.py:from mock import Mock

Environment (please complete the following information)

  • OS: Debian sid
  • Python version: 3.13, 3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions