Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ markers =
aiobotocore
kafka
grpc
azurestorage
addopts=--random-order

[isort]
Expand Down
2 changes: 1 addition & 1 deletion tests/client/client_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import time
import warnings
from collections import defaultdict
from unittest import mock

import mock
import pytest
from pytest_localserver.http import ContentServer
from pytest_localserver.https import DEFAULT_CERTIFICATE
Expand Down
2 changes: 1 addition & 1 deletion tests/client/exception_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import os
from unittest import mock

import mock
import pytest

import elasticapm
Expand Down
2 changes: 1 addition & 1 deletion tests/client/py3_exception_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#
#

import mock
from unittest import mock

from elasticapm.conf.constants import ERROR

Expand Down
3 changes: 2 additions & 1 deletion tests/config/central_config_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import mock
from unittest import mock

import pytest


Expand Down
2 changes: 1 addition & 1 deletion tests/config/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import platform
import stat
from datetime import timedelta
from unittest import mock

import mock
import pytest

import elasticapm.conf
Expand Down
3 changes: 2 additions & 1 deletion tests/contrib/asyncio/aiohttp_web_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

aiohttp = pytest.importorskip("aiohttp") # isort:skip

import mock
from unittest import mock

from multidict import MultiDict

import elasticapm
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/asyncio/starlette_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
starlette = pytest.importorskip("starlette") # isort:skip

import os
from unittest import mock

import mock
import urllib3
import wrapt
from starlette.applications import Starlette
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/asyncio/tornado/tornado_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
tornado = pytest.importorskip("tornado") # isort:skip

import os
from unittest import mock

import mock
from wrapt import BoundFunctionWrapper

import elasticapm
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/celery/flask_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
flask = pytest.importorskip("flask") # isort:skip
celery = pytest.importorskip("celery") # isort:skip

import mock
from unittest import mock

from elasticapm.conf.constants import ERROR, TRANSACTION

Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/django/django_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
import logging
import os
from copy import deepcopy
from unittest import mock

import mock
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.redirects.models import Redirect
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/django/wrapper_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Installing an app is not reversible, so using this instrumentation "for real" would
# pollute the Django instance used by pytest.

import mock
from unittest import mock

from elasticapm.instrumentation.packages.django import DjangoAutoInstrumentation

Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/flask/flask_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
import io
import logging
import os
from unittest import mock
from urllib.request import urlopen

import mock
from flask import signals

import elasticapm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

import datetime
import os
from unittest import mock

import azure.functions as func
import mock

import elasticapm
from elasticapm.conf import constants
Expand Down
3 changes: 2 additions & 1 deletion tests/events/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@

from __future__ import absolute_import

from unittest.mock import Mock

import pytest
from mock import Mock

from elasticapm.events import Exception, Message

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
import zlib
from collections import defaultdict
from typing import Optional
from unittest import mock
from urllib.request import pathname2url

import jsonschema
import mock
import pytest
from pytest_localserver.http import ContentServer
from werkzeug.wrappers import Request, Response
Expand Down
2 changes: 1 addition & 1 deletion tests/instrumentation/base_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import logging
from unittest import mock

import mock
import pytest
import wrapt

Expand Down
2 changes: 1 addition & 1 deletion tests/instrumentation/transactions_store_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import logging
import time
from collections import defaultdict
from unittest import mock

import mock
import pytest

import elasticapm
Expand Down
2 changes: 1 addition & 1 deletion tests/instrumentation/urllib_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import urllib.parse
from unittest import mock
from urllib.error import HTTPError, URLError
from urllib.request import urlopen

import mock
import pytest

from elasticapm.conf import constants
Expand Down
2 changes: 1 addition & 1 deletion tests/metrics/base_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import logging
import time
from multiprocessing.dummy import Pool
from unittest import mock

import mock
import pytest

from elasticapm.conf import constants
Expand Down
3 changes: 2 additions & 1 deletion tests/metrics/breakdown_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import mock
from unittest import mock

import pytest

import elasticapm
Expand Down
6 changes: 4 additions & 2 deletions tests/processors/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

import logging
import os
from unittest import mock

import mock
import pytest

import elasticapm
Expand Down Expand Up @@ -464,7 +464,9 @@ def test_drop_events_in_processor(elasticapm_client, caplog):
assert shouldnt_be_called_processor.call_count == 0
assert elasticapm_client._transport.events[TRANSACTION][0] is None
assert_any_record_contains(
caplog.records, "Dropped event of type transaction due to processor mock.mock.dropper", "elasticapm.transport"
caplog.records,
"Dropped event of type transaction due to processor unittest.mock.dropper",
"elasticapm.transport",
)


Expand Down
1 change: 0 additions & 1 deletion tests/requirements/lint-isort.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
isort
mock
1 change: 0 additions & 1 deletion tests/requirements/reqs-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jsonschema==4.17.3
urllib3!=2.0.0,<3.0.0
certifi
Logbook
mock
pytz
ecs_logging
structlog
Expand Down
1 change: 1 addition & 0 deletions tests/scripts/envs/azure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PYTEST_MARKER="-m azurestorage"
2 changes: 1 addition & 1 deletion tests/transports/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import sys
import time
import timeit
from unittest import mock

import mock
import pytest

from elasticapm.transport.base import Transport, TransportState
Expand Down
2 changes: 1 addition & 1 deletion tests/transports/test_urllib3.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

import os
import time
from unittest import mock

import certifi
import mock
import pytest
import urllib3.poolmanager
from urllib3.exceptions import MaxRetryError, TimeoutError
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/cloud_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import os
from unittest import mock

import mock
import urllib3

import elasticapm.utils.cloud
Expand Down
3 changes: 2 additions & 1 deletion tests/utils/compat_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import mock
from unittest import mock

import pytest

from elasticapm.utils import compat
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/stacks/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@

import os
import pkgutil
from unittest.mock import Mock

import pytest
from mock import Mock

import elasticapm
from elasticapm.conf import constants
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/threading_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

import platform
import time
from unittest import mock

import mock
import pytest

from elasticapm.utils.threading import IntervalTimer
Expand Down
Loading