elastic / elastic/apm-agent-python
use unittest.mock instead of mock in tests
- Dominant language
- Python
- Stars
- 431
- Forks
- 239
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 7
Description
**Describe the bug**:
with 7241b27ba9f190167c70abc728f629061396d0fb 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
Contributor guide
Assessment
This issue has not been assessed yet.