From 7495c9e49a7948a0115fe1f438a493d38964eb63 Mon Sep 17 00:00:00 2001 From: Hannah Stepanek Date: Wed, 12 Jun 2024 12:51:31 -0700 Subject: [PATCH 1/3] Disable package capture when testing --- tests/adapter_asgiref/conftest.py | 1 + tests/adapter_cheroot/conftest.py | 22 +++++----- tests/adapter_daphne/conftest.py | 7 +++- tests/adapter_gevent/conftest.py | 29 +++++++------ tests/adapter_gunicorn/conftest.py | 21 ++++++---- tests/adapter_hypercorn/conftest.py | 7 +++- tests/adapter_uvicorn/conftest.py | 8 ++-- tests/adapter_waitress/conftest.py | 1 + tests/agent_features/conftest.py | 10 +++-- tests/agent_streaming/conftest.py | 7 +++- tests/agent_unittests/conftest.py | 6 ++- tests/application_celery/conftest.py | 1 + tests/application_gearman/conftest.py | 22 +++++----- .../component_djangorestframework/conftest.py | 24 ++++++----- tests/component_flask_rest/conftest.py | 24 ++++++----- tests/component_graphqlserver/conftest.py | 7 +++- tests/component_tastypie/conftest.py | 24 ++++++----- tests/coroutines_asyncio/conftest.py | 8 ++-- tests/cross_agent/conftest.py | 24 ++++++----- tests/datastore_aioredis/conftest.py | 17 +++++--- tests/datastore_aredis/conftest.py | 25 ++++++----- tests/datastore_asyncpg/conftest.py | 7 +++- tests/datastore_bmemcached/conftest.py | 25 ++++++----- tests/datastore_elasticsearch/conftest.py | 8 ++-- tests/datastore_firestore/conftest.py | 26 +++++++----- tests/datastore_memcache/conftest.py | 39 ++++++++++-------- tests/datastore_mysql/conftest.py | 29 +++++++------ tests/datastore_postgresql/conftest.py | 1 + tests/datastore_psycopg/conftest.py | 1 + tests/datastore_psycopg2/conftest.py | 27 ++++++------ tests/datastore_psycopg2cffi/conftest.py | 27 ++++++------ tests/datastore_pylibmc/conftest.py | 25 ++++++----- tests/datastore_pymemcache/conftest.py | 25 ++++++----- tests/datastore_pymongo/conftest.py | 7 +++- tests/datastore_pymssql/conftest.py | 7 ++-- tests/datastore_pymysql/conftest.py | 27 ++++++------ tests/datastore_pyodbc/conftest.py | 1 + tests/datastore_pysolr/conftest.py | 25 ++++++----- tests/datastore_redis/conftest.py | 29 +++++++------ tests/datastore_rediscluster/conftest.py | 1 + tests/datastore_solrpy/conftest.py | 25 ++++++----- tests/datastore_sqlite/conftest.py | 27 ++++++------ tests/external_aiobotocore/conftest.py | 1 + tests/external_botocore/conftest.py | 1 + tests/external_feedparser/conftest.py | 23 +++++++---- tests/external_http/conftest.py | 28 +++++++------ tests/external_httplib/conftest.py | 27 ++++++------ tests/external_httplib2/conftest.py | 29 +++++++------ tests/external_httpx/conftest.py | 7 +++- tests/external_requests/conftest.py | 28 +++++++------ tests/external_urllib3/conftest.py | 29 +++++++------ tests/framework_aiohttp/conftest.py | 8 ++-- tests/framework_ariadne/conftest.py | 1 + tests/framework_bottle/conftest.py | 26 +++++++----- tests/framework_cherrypy/conftest.py | 22 +++++----- tests/framework_django/conftest.py | 26 ++++++------ tests/framework_falcon/conftest.py | 23 ++++++----- tests/framework_fastapi/conftest.py | 7 +++- tests/framework_flask/conftest.py | 28 +++++++------ tests/framework_graphene/conftest.py | 1 + tests/framework_graphql/conftest.py | 1 + tests/framework_grpc/conftest.py | 8 ++-- tests/framework_pyramid/conftest.py | 22 +++++----- tests/framework_sanic/conftest.py | 8 ++-- tests/framework_starlette/conftest.py | 7 +++- tests/framework_strawberry/conftest.py | 1 + tests/framework_tornado/conftest.py | 27 ++++++------ tests/logger_logging/conftest.py | 1 + tests/logger_loguru/conftest.py | 1 + tests/logger_structlog/conftest.py | 1 + .../messagebroker_confluentkafka/conftest.py | 7 +++- tests/messagebroker_kafkapython/conftest.py | 7 +++- tests/messagebroker_pika/conftest.py | 7 +++- tests/mlmodel_langchain/conftest.py | 1 + tests/mlmodel_openai/conftest.py | 1 + tests/mlmodel_sklearn/conftest.py | 3 +- tests/mlmodel_sklearn/restats | Bin 0 -> 277 bytes tests/template_genshi/conftest.py | 1 + tests/template_jinja2/conftest.py | 1 + tests/template_mako/conftest.py | 21 ++++++---- 80 files changed, 657 insertions(+), 468 deletions(-) create mode 100644 tests/mlmodel_sklearn/restats diff --git a/tests/adapter_asgiref/conftest.py b/tests/adapter_asgiref/conftest.py index e350688614..e840a574ac 100644 --- a/tests/adapter_asgiref/conftest.py +++ b/tests/adapter_asgiref/conftest.py @@ -20,6 +20,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/adapter_cheroot/conftest.py b/tests/adapter_cheroot/conftest.py index 37d9d4df4a..34a855d9ea 100644 --- a/tests/adapter_cheroot/conftest.py +++ b/tests/adapter_cheroot/conftest.py @@ -13,18 +13,20 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (adapter_cheroot)', - default_settings=_default_settings) + app_name="Python Agent Test (adapter_cheroot)", default_settings=_default_settings +) diff --git a/tests/adapter_daphne/conftest.py b/tests/adapter_daphne/conftest.py index 3b35b2ee65..6ee940fbbb 100644 --- a/tests/adapter_daphne/conftest.py +++ b/tests/adapter_daphne/conftest.py @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/adapter_gevent/conftest.py b/tests/adapter_gevent/conftest.py index 01dacc9e69..41abbb7f41 100644 --- a/tests/adapter_gevent/conftest.py +++ b/tests/adapter_gevent/conftest.py @@ -14,24 +14,29 @@ import pytest import webtest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.disable_harvest_until_shutdown': False, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.disable_harvest_until_shutdown": False, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (adapter_gevent)', - default_settings=_default_settings) + app_name="Python Agent Test (adapter_gevent)", default_settings=_default_settings +) + -@pytest.fixture(autouse=True, scope='session') +@pytest.fixture(autouse=True, scope="session") def target_application(): import _application + port = _application.setup_application() - return webtest.TestApp('http://localhost:%d' % port) + return webtest.TestApp("http://localhost:%d" % port) diff --git a/tests/adapter_gunicorn/conftest.py b/tests/adapter_gunicorn/conftest.py index 228742c964..4f30485934 100644 --- a/tests/adapter_gunicorn/conftest.py +++ b/tests/adapter_gunicorn/conftest.py @@ -13,17 +13,20 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (gunicorn)', - default_settings=_default_settings) + app_name="Python Agent Test (gunicorn)", default_settings=_default_settings +) diff --git a/tests/adapter_hypercorn/conftest.py b/tests/adapter_hypercorn/conftest.py index 2276e9415f..e6311a88d6 100644 --- a/tests/adapter_hypercorn/conftest.py +++ b/tests/adapter_hypercorn/conftest.py @@ -15,10 +15,13 @@ from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 event_loop as loop, ) -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/adapter_uvicorn/conftest.py b/tests/adapter_uvicorn/conftest.py index 4f2f7c2df4..29c1c0239f 100644 --- a/tests/adapter_uvicorn/conftest.py +++ b/tests/adapter_uvicorn/conftest.py @@ -13,11 +13,13 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/adapter_waitress/conftest.py b/tests/adapter_waitress/conftest.py index aecbfd86d6..e9024469d1 100644 --- a/tests/adapter_waitress/conftest.py +++ b/tests/adapter_waitress/conftest.py @@ -20,6 +20,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/agent_features/conftest.py b/tests/agent_features/conftest.py index b8c8972d34..367be3d86f 100644 --- a/tests/agent_features/conftest.py +++ b/tests/agent_features/conftest.py @@ -13,16 +13,18 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 newrelic_caplog as caplog, ) from newrelic.packages import six - _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, @@ -30,7 +32,7 @@ "debug.record_transaction_failure": True, "debug.log_autorum_middleware": True, "agent_limits.errors_per_harvest": 100, - "ml_insights_events.enabled": True + "ml_insights_events.enabled": True, } collector_agent_registration = collector_agent_registration_fixture( diff --git a/tests/agent_streaming/conftest.py b/tests/agent_streaming/conftest.py index 390aeda9cb..a88d47828c 100644 --- a/tests/agent_streaming/conftest.py +++ b/tests/agent_streaming/conftest.py @@ -15,8 +15,10 @@ import threading import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_grpc_server import MockExternalgRPCServer from newrelic.common.streaming_utils import StreamBuffer @@ -25,6 +27,7 @@ _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/agent_unittests/conftest.py b/tests/agent_unittests/conftest.py index 1504d1b8d9..fd5630f81e 100644 --- a/tests/agent_unittests/conftest.py +++ b/tests/agent_unittests/conftest.py @@ -16,8 +16,10 @@ import tempfile import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 newrelic_caplog as caplog, ) diff --git a/tests/application_celery/conftest.py b/tests/application_celery/conftest.py index d0a38fa35c..90bc93c719 100644 --- a/tests/application_celery/conftest.py +++ b/tests/application_celery/conftest.py @@ -18,6 +18,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/application_gearman/conftest.py b/tests/application_gearman/conftest.py index 6a38806e2e..2a2c2aeb0c 100644 --- a/tests/application_gearman/conftest.py +++ b/tests/application_gearman/conftest.py @@ -13,18 +13,20 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (application_gearman)', - default_settings=_default_settings) + app_name="Python Agent Test (application_gearman)", default_settings=_default_settings +) diff --git a/tests/component_djangorestframework/conftest.py b/tests/component_djangorestframework/conftest.py index a4b37571dc..d3d527291e 100644 --- a/tests/component_djangorestframework/conftest.py +++ b/tests/component_djangorestframework/conftest.py @@ -13,19 +13,21 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_autorum_middleware': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_autorum_middleware": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (component_djangorestframework)', - default_settings=_default_settings) + app_name="Python Agent Test (component_djangorestframework)", default_settings=_default_settings +) diff --git a/tests/component_flask_rest/conftest.py b/tests/component_flask_rest/conftest.py index ff00973ab6..e8d6e8b927 100644 --- a/tests/component_flask_rest/conftest.py +++ b/tests/component_flask_rest/conftest.py @@ -13,19 +13,21 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_autorum_middleware': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_autorum_middleware": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (component_flask_rest)', - default_settings=_default_settings) + app_name="Python Agent Test (component_flask_rest)", default_settings=_default_settings +) diff --git a/tests/component_graphqlserver/conftest.py b/tests/component_graphqlserver/conftest.py index f62af82100..26613da4f1 100644 --- a/tests/component_graphqlserver/conftest.py +++ b/tests/component_graphqlserver/conftest.py @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/component_tastypie/conftest.py b/tests/component_tastypie/conftest.py index e38e3b2f31..cd64d6dcb1 100644 --- a/tests/component_tastypie/conftest.py +++ b/tests/component_tastypie/conftest.py @@ -13,19 +13,21 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_autorum_middleware': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_autorum_middleware": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (component_tastypie)', - default_settings=_default_settings) + app_name="Python Agent Test (component_tastypie)", default_settings=_default_settings +) diff --git a/tests/coroutines_asyncio/conftest.py b/tests/coroutines_asyncio/conftest.py index 5d3d843d01..ccb5db4428 100644 --- a/tests/coroutines_asyncio/conftest.py +++ b/tests/coroutines_asyncio/conftest.py @@ -13,12 +13,14 @@ # limitations under the License. import pytest - from testing_support.fixture.event_loop import event_loop -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/cross_agent/conftest.py b/tests/cross_agent/conftest.py index d21ebf236e..54862dd4dd 100644 --- a/tests/cross_agent/conftest.py +++ b/tests/cross_agent/conftest.py @@ -13,19 +13,21 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_autorum_middleware': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_autorum_middleware": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (cross_agent_tests)', - default_settings=_default_settings) + app_name="Python Agent Test (cross_agent_tests)", default_settings=_default_settings +) diff --git a/tests/datastore_aioredis/conftest.py b/tests/datastore_aioredis/conftest.py index e1cea4c01b..b4f8d9fd1f 100644 --- a/tests/datastore_aioredis/conftest.py +++ b/tests/datastore_aioredis/conftest.py @@ -13,13 +13,16 @@ # limitations under the License. import os -import pytest -from newrelic.common.package_version_utils import get_package_version_tuple +import pytest from testing_support.db_settings import redis_settings - from testing_support.fixture.event_loop import event_loop as loop -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) + +from newrelic.common.package_version_utils import get_package_version_tuple try: import aioredis @@ -38,6 +41,7 @@ _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, @@ -63,12 +67,15 @@ def client(request, loop): raise NotImplementedError() else: if request.param == "Redis": - return loop.run_until_complete(aioredis.create_redis("redis://%s:%d" % (DB_SETTINGS["host"], DB_SETTINGS["port"]), db=0)) + return loop.run_until_complete( + aioredis.create_redis("redis://%s:%d" % (DB_SETTINGS["host"], DB_SETTINGS["port"]), db=0) + ) elif request.param == "StrictRedis": pytest.skip("StrictRedis not implemented.") else: raise NotImplementedError() + @pytest.fixture(scope="session") def key(): return "AIOREDIS-TEST-" + str(os.getpid()) diff --git a/tests/datastore_aredis/conftest.py b/tests/datastore_aredis/conftest.py index 78067e0fed..0452e7fe63 100644 --- a/tests/datastore_aredis/conftest.py +++ b/tests/datastore_aredis/conftest.py @@ -13,20 +13,23 @@ # limitations under the License. import pytest - from testing_support.fixture.event_loop import event_loop as loop # noqa: F401 -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_aredis)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_aredis)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_asyncpg/conftest.py b/tests/datastore_asyncpg/conftest.py index 69bc0501a2..800917e3e2 100644 --- a/tests/datastore_asyncpg/conftest.py +++ b/tests/datastore_asyncpg/conftest.py @@ -13,10 +13,13 @@ # limitations under the License. from testing_support.fixture.event_loop import event_loop - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/datastore_bmemcached/conftest.py b/tests/datastore_bmemcached/conftest.py index c970c1c347..128a3609ac 100644 --- a/tests/datastore_bmemcached/conftest.py +++ b/tests/datastore_bmemcached/conftest.py @@ -13,19 +13,22 @@ # limitations under the License. import pytest - - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_bmemcached)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_bmemcached)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_elasticsearch/conftest.py b/tests/datastore_elasticsearch/conftest.py index 53fa6fcdc3..4377112e60 100644 --- a/tests/datastore_elasticsearch/conftest.py +++ b/tests/datastore_elasticsearch/conftest.py @@ -14,13 +14,15 @@ import pytest from testing_support.db_settings import elasticsearch_settings - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from newrelic.common.package_version_utils import get_package_version - _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/datastore_firestore/conftest.py b/tests/datastore_firestore/conftest.py index 28e138fa28..ca54a08383 100644 --- a/tests/datastore_firestore/conftest.py +++ b/tests/datastore_firestore/conftest.py @@ -15,12 +15,11 @@ import uuid import pytest - -from google.cloud.firestore import Client -from google.cloud.firestore import Client, AsyncClient - +from google.cloud.firestore import AsyncClient, Client from testing_support.db_settings import firestore_settings -from testing_support.fixture.event_loop import event_loop as loop # noqa: F401; pylint: disable=W0611 +from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 + event_loop as loop, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, @@ -35,6 +34,7 @@ FIRESTORE_PORT = DB_SETTINGS["port"] _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, @@ -53,7 +53,11 @@ @pytest.fixture() def instance_info(): host = gethostname() if FIRESTORE_HOST in LOCALHOST_EQUIVALENTS else FIRESTORE_HOST - return {"host": host, "port_path_or_id": str(FIRESTORE_PORT), "db.instance": "projects/google-cloud-firestore-emulator/databases/(default)"} + return { + "host": host, + "port_path_or_id": str(FIRESTORE_PORT), + "db.instance": "projects/google-cloud-firestore-emulator/databases/(default)", + } @pytest.fixture(scope="session") @@ -61,9 +65,7 @@ def client(): os.environ["FIRESTORE_EMULATOR_HOST"] = "%s:%d" % (FIRESTORE_HOST, FIRESTORE_PORT) client = Client() # Ensure connection is available - client.collection("healthcheck").document("healthcheck").set( - {}, retry=None, timeout=5 - ) + client.collection("healthcheck").document("healthcheck").set({}, retry=None, timeout=5) return client @@ -78,7 +80,9 @@ def collection(client): def async_client(loop): os.environ["FIRESTORE_EMULATOR_HOST"] = "%s:%d" % (FIRESTORE_HOST, FIRESTORE_PORT) client = AsyncClient() - loop.run_until_complete(client.collection("healthcheck").document("healthcheck").set({}, retry=None, timeout=5)) # Ensure connection is available + loop.run_until_complete( + client.collection("healthcheck").document("healthcheck").set({}, retry=None, timeout=5) + ) # Ensure connection is available return client @@ -110,7 +114,7 @@ def _assert_trace_for_async_generator(generator_func, *args, **kwargs): _trace_check = [] txn = current_trace() assert not isinstance(txn, DatastoreTrace) - + async def coro(): # Check for generator trace on collections async for _ in generator_func(*args, **kwargs): diff --git a/tests/datastore_memcache/conftest.py b/tests/datastore_memcache/conftest.py index 835e895bd8..7812cea264 100644 --- a/tests/datastore_memcache/conftest.py +++ b/tests/datastore_memcache/conftest.py @@ -14,32 +14,36 @@ import random import string -import pytest -import memcache - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +import memcache +import pytest from testing_support.db_settings import memcached_settings - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_memcache)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_memcache)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) + -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def memcached_multi(): """Generate keys that will go onto different servers""" DB_SETTINGS = memcached_settings() - db_servers = ['%s:%s' % (s['host'], s['port']) for s in DB_SETTINGS] + db_servers = ["%s:%s" % (s["host"], s["port"]) for s in DB_SETTINGS] clients = [memcache.Client([s]) for s in db_servers] client_all = memcache.Client(db_servers) @@ -48,9 +52,8 @@ def memcached_multi(): for try_num in range(10 * num_servers): multi_dict = {} for i in range(num_servers): - random_chars = (random.choice(string.ascii_uppercase) - for _ in range(10)) - key_candidate = ''.join(random_chars) + random_chars = (random.choice(string.ascii_uppercase) for _ in range(10)) + key_candidate = "".join(random_chars) multi_dict[key_candidate] = key_candidate client_all.set_multi(multi_dict) diff --git a/tests/datastore_mysql/conftest.py b/tests/datastore_mysql/conftest.py index a2f74c398f..bc241617d4 100644 --- a/tests/datastore_mysql/conftest.py +++ b/tests/datastore_mysql/conftest.py @@ -12,25 +12,30 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest import os -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +import pytest +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_explain_plan_queries': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_explain_plan_queries": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_mysql)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_mysql)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) + @pytest.fixture(scope="session") def table_name(): diff --git a/tests/datastore_postgresql/conftest.py b/tests/datastore_postgresql/conftest.py index 4a25f25742..545de0f7d0 100644 --- a/tests/datastore_postgresql/conftest.py +++ b/tests/datastore_postgresql/conftest.py @@ -18,6 +18,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/datastore_psycopg/conftest.py b/tests/datastore_psycopg/conftest.py index 4a066086e0..dd6a174d9e 100644 --- a/tests/datastore_psycopg/conftest.py +++ b/tests/datastore_psycopg/conftest.py @@ -21,6 +21,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/datastore_psycopg2/conftest.py b/tests/datastore_psycopg2/conftest.py index dd271909d7..832b52e123 100644 --- a/tests/datastore_psycopg2/conftest.py +++ b/tests/datastore_psycopg2/conftest.py @@ -13,20 +13,23 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_explain_plan_queries': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_explain_plan_queries": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_psycopg2)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_psycopg2)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_psycopg2cffi/conftest.py b/tests/datastore_psycopg2cffi/conftest.py index c9df1369bb..96d71b3ef8 100644 --- a/tests/datastore_psycopg2cffi/conftest.py +++ b/tests/datastore_psycopg2cffi/conftest.py @@ -13,20 +13,23 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_explain_plan_queries': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_explain_plan_queries": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_psycopg2cffi)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_psycopg2cffi)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_pylibmc/conftest.py b/tests/datastore_pylibmc/conftest.py index 40970bdcae..258c7cf5a6 100644 --- a/tests/datastore_pylibmc/conftest.py +++ b/tests/datastore_pylibmc/conftest.py @@ -13,19 +13,22 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_pylibmc)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_pylibmc)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_pymemcache/conftest.py b/tests/datastore_pymemcache/conftest.py index 3d4e1ce766..316b355879 100644 --- a/tests/datastore_pymemcache/conftest.py +++ b/tests/datastore_pymemcache/conftest.py @@ -13,19 +13,22 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_pymemcache)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_pymemcache)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_pymongo/conftest.py b/tests/datastore_pymongo/conftest.py index d269182b03..0579578328 100644 --- a/tests/datastore_pymongo/conftest.py +++ b/tests/datastore_pymongo/conftest.py @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/datastore_pymssql/conftest.py b/tests/datastore_pymssql/conftest.py index a6584cdffe..fc3cd17f23 100644 --- a/tests/datastore_pymssql/conftest.py +++ b/tests/datastore_pymssql/conftest.py @@ -13,14 +13,13 @@ # limitations under the License. import pytest - -from testing_support.fixtures import ( +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, -) # noqa: F401; pylint: disable=W0611 - +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/datastore_pymysql/conftest.py b/tests/datastore_pymysql/conftest.py index 51d037432d..86eee574a9 100644 --- a/tests/datastore_pymysql/conftest.py +++ b/tests/datastore_pymysql/conftest.py @@ -13,20 +13,23 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_explain_plan_queries': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_explain_plan_queries": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_pymysql)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_pymysql)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_pyodbc/conftest.py b/tests/datastore_pyodbc/conftest.py index b00a0a663f..dd646b0625 100644 --- a/tests/datastore_pyodbc/conftest.py +++ b/tests/datastore_pyodbc/conftest.py @@ -18,6 +18,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/datastore_pysolr/conftest.py b/tests/datastore_pysolr/conftest.py index 07851b6981..e5554b82c4 100644 --- a/tests/datastore_pysolr/conftest.py +++ b/tests/datastore_pysolr/conftest.py @@ -13,19 +13,22 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_pysolr)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_pysolr)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_redis/conftest.py b/tests/datastore_redis/conftest.py index 6747039b47..c00791164a 100644 --- a/tests/datastore_redis/conftest.py +++ b/tests/datastore_redis/conftest.py @@ -13,20 +13,25 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 -from testing_support.fixture.event_loop import event_loop as loop # noqa: F401; pylint: disable=W0611 - +from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 + event_loop as loop, +) +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_redis)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_redis)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_rediscluster/conftest.py b/tests/datastore_rediscluster/conftest.py index fe53f1fe20..424ffc6f63 100644 --- a/tests/datastore_rediscluster/conftest.py +++ b/tests/datastore_rediscluster/conftest.py @@ -18,6 +18,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/datastore_solrpy/conftest.py b/tests/datastore_solrpy/conftest.py index 4418e5d9a4..de8fa5bb9c 100644 --- a/tests/datastore_solrpy/conftest.py +++ b/tests/datastore_solrpy/conftest.py @@ -13,19 +13,22 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_solrpy)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_solrpy)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/datastore_sqlite/conftest.py b/tests/datastore_sqlite/conftest.py index ed695b251f..328669cbe8 100644 --- a/tests/datastore_sqlite/conftest.py +++ b/tests/datastore_sqlite/conftest.py @@ -13,20 +13,23 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_explain_plan_queries': True + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_explain_plan_queries": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (datastore_sqlite)', - default_settings=_default_settings, - linked_applications=['Python Agent Test (datastore)']) + app_name="Python Agent Test (datastore_sqlite)", + default_settings=_default_settings, + linked_applications=["Python Agent Test (datastore)"], +) diff --git a/tests/external_aiobotocore/conftest.py b/tests/external_aiobotocore/conftest.py index 558167ec24..2c54daf31f 100644 --- a/tests/external_aiobotocore/conftest.py +++ b/tests/external_aiobotocore/conftest.py @@ -34,6 +34,7 @@ _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/external_botocore/conftest.py b/tests/external_botocore/conftest.py index 3ac1920035..026ece7689 100644 --- a/tests/external_botocore/conftest.py +++ b/tests/external_botocore/conftest.py @@ -39,6 +39,7 @@ BOTOCORE_VERSION = get_package_version("botocore") _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/external_feedparser/conftest.py b/tests/external_feedparser/conftest.py index 11d19f1cd5..136cfa8787 100644 --- a/tests/external_feedparser/conftest.py +++ b/tests/external_feedparser/conftest.py @@ -13,21 +13,24 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_http_server import MockExternalHTTPServer _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (external_feedparser)', - default_settings=_default_settings) + app_name="Python Agent Test (external_feedparser)", default_settings=_default_settings +) def create_handler(response): @@ -35,8 +38,10 @@ def handler(self): self.send_response(200) self.end_headers() self.wfile.write(response) + return handler + @pytest.fixture(scope="session") def server(): with open("packages.xml", "rb") as f: diff --git a/tests/external_http/conftest.py b/tests/external_http/conftest.py index f8afb49f3b..5d18222499 100644 --- a/tests/external_http/conftest.py +++ b/tests/external_http/conftest.py @@ -13,25 +13,29 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_http_server import ( - MockExternalHTTPHResponseHeadersServer) - + MockExternalHTTPHResponseHeadersServer, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (external_http)', - default_settings=_default_settings) + app_name="Python Agent Test (external_http)", default_settings=_default_settings +) + -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def server(): with MockExternalHTTPHResponseHeadersServer() as _server: yield _server diff --git a/tests/external_httplib/conftest.py b/tests/external_httplib/conftest.py index 2edbeab911..729523599a 100644 --- a/tests/external_httplib/conftest.py +++ b/tests/external_httplib/conftest.py @@ -13,26 +13,29 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_http_server import ( - MockExternalHTTPHResponseHeadersServer) - + MockExternalHTTPHResponseHeadersServer, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (external_httplib)', - default_settings=_default_settings) + app_name="Python Agent Test (external_httplib)", default_settings=_default_settings +) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def server(): with MockExternalHTTPHResponseHeadersServer() as _server: yield _server diff --git a/tests/external_httplib2/conftest.py b/tests/external_httplib2/conftest.py index cf3501da50..55797d84a2 100644 --- a/tests/external_httplib2/conftest.py +++ b/tests/external_httplib2/conftest.py @@ -13,26 +13,29 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_http_server import ( - MockExternalHTTPHResponseHeadersServer) - + MockExternalHTTPHResponseHeadersServer, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (external_httplib2)', - default_settings=_default_settings) + app_name="Python Agent Test (external_httplib2)", default_settings=_default_settings +) + -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def server(): with MockExternalHTTPHResponseHeadersServer() as _server: yield _server diff --git a/tests/external_httpx/conftest.py b/tests/external_httpx/conftest.py index 87ea1bec06..fcaf35835a 100644 --- a/tests/external_httpx/conftest.py +++ b/tests/external_httpx/conftest.py @@ -16,10 +16,13 @@ import pytest from testing_support.fixture.event_loop import event_loop as loop -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/external_requests/conftest.py b/tests/external_requests/conftest.py index 10a2ccf051..15426c3a56 100644 --- a/tests/external_requests/conftest.py +++ b/tests/external_requests/conftest.py @@ -13,25 +13,29 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_http_server import ( - MockExternalHTTPHResponseHeadersServer) - + MockExternalHTTPHResponseHeadersServer, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (external_requests)', - default_settings=_default_settings) + app_name="Python Agent Test (external_requests)", default_settings=_default_settings +) + -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def server(): with MockExternalHTTPHResponseHeadersServer() as _server: yield _server diff --git a/tests/external_urllib3/conftest.py b/tests/external_urllib3/conftest.py index 19d3f394bd..e380eda1be 100644 --- a/tests/external_urllib3/conftest.py +++ b/tests/external_urllib3/conftest.py @@ -13,26 +13,29 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_http_server import ( - MockExternalHTTPHResponseHeadersServer) - + MockExternalHTTPHResponseHeadersServer, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (external_urllib3)', - default_settings=_default_settings) + app_name="Python Agent Test (external_urllib3)", default_settings=_default_settings +) + -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def server(): with MockExternalHTTPHResponseHeadersServer() as _server: yield _server diff --git a/tests/framework_aiohttp/conftest.py b/tests/framework_aiohttp/conftest.py index 3bb814a9b2..317383f0c2 100644 --- a/tests/framework_aiohttp/conftest.py +++ b/tests/framework_aiohttp/conftest.py @@ -22,15 +22,17 @@ from testing_support.fixture.event_loop import ( # noqa: F401 pylint: disable=W0611 event_loop, ) - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_http_server import ( MockExternalHTTPHResponseHeadersServer, MockExternalHTTPServer, ) - _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_ariadne/conftest.py b/tests/framework_ariadne/conftest.py index 7bc5153eb5..e9de51e7da 100644 --- a/tests/framework_ariadne/conftest.py +++ b/tests/framework_ariadne/conftest.py @@ -20,6 +20,7 @@ from newrelic.packages import six _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_bottle/conftest.py b/tests/framework_bottle/conftest.py index 095a3331f3..5e30983702 100644 --- a/tests/framework_bottle/conftest.py +++ b/tests/framework_bottle/conftest.py @@ -13,23 +13,27 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (framework_bottle)', - default_settings=_default_settings) + app_name="Python Agent Test (framework_bottle)", default_settings=_default_settings +) -@pytest.fixture(scope='function') + +@pytest.fixture(scope="function") def target_application(): import _target_application + return _target_application.target_application diff --git a/tests/framework_cherrypy/conftest.py b/tests/framework_cherrypy/conftest.py index bc730bb1fa..6f7832eba7 100644 --- a/tests/framework_cherrypy/conftest.py +++ b/tests/framework_cherrypy/conftest.py @@ -13,18 +13,20 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (framework_cherrypy)', - default_settings=_default_settings) + app_name="Python Agent Test (framework_cherrypy)", default_settings=_default_settings +) diff --git a/tests/framework_django/conftest.py b/tests/framework_django/conftest.py index 8a43ef5c90..d657a22bc6 100644 --- a/tests/framework_django/conftest.py +++ b/tests/framework_django/conftest.py @@ -13,20 +13,22 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_autorum_middleware': True, - 'feature_flag': set(['django.instrumentation.inclusion-tags.r1']), + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_autorum_middleware": True, + "feature_flag": set(["django.instrumentation.inclusion-tags.r1"]), } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (framework_django)', - default_settings=_default_settings) + app_name="Python Agent Test (framework_django)", default_settings=_default_settings +) diff --git a/tests/framework_falcon/conftest.py b/tests/framework_falcon/conftest.py index fd43715c6e..8b781fed07 100644 --- a/tests/framework_falcon/conftest.py +++ b/tests/framework_falcon/conftest.py @@ -13,24 +13,27 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (framework_falcon)', - default_settings=_default_settings) + app_name="Python Agent Test (framework_falcon)", default_settings=_default_settings +) @pytest.fixture() def app(): from _target_application import _target_application + return _target_application diff --git a/tests/framework_fastapi/conftest.py b/tests/framework_fastapi/conftest.py index d65398ffb9..e53e597061 100644 --- a/tests/framework_fastapi/conftest.py +++ b/tests/framework_fastapi/conftest.py @@ -13,13 +13,16 @@ # limitations under the License. import pytest -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 newrelic_caplog as caplog, ) - _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_flask/conftest.py b/tests/framework_flask/conftest.py index f90ed9b512..428b984c21 100644 --- a/tests/framework_flask/conftest.py +++ b/tests/framework_flask/conftest.py @@ -16,28 +16,30 @@ import pytest from flask import __version__ as flask_version - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, - 'debug.log_autorum_middleware': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, + "debug.log_autorum_middleware": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (framework_flask)', - default_settings=_default_settings) + app_name="Python Agent Test (framework_flask)", default_settings=_default_settings +) -is_flask_v2 = int(flask_version.split('.')[0]) >= 2 +is_flask_v2 = int(flask_version.split(".")[0]) >= 2 is_pypy = platform.python_implementation() == "PyPy" async_handler_support = is_flask_v2 and not is_pypy skip_if_not_async_handler_support = pytest.mark.skipif( not async_handler_support, reason="Requires async handler support. (Flask >=v2.0.0)", -) \ No newline at end of file +) diff --git a/tests/framework_graphene/conftest.py b/tests/framework_graphene/conftest.py index 7a6f88554a..12f69f5a35 100644 --- a/tests/framework_graphene/conftest.py +++ b/tests/framework_graphene/conftest.py @@ -21,6 +21,7 @@ from newrelic.packages import six _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_graphql/conftest.py b/tests/framework_graphql/conftest.py index 5302da2b80..fdf1bf5cf8 100644 --- a/tests/framework_graphql/conftest.py +++ b/tests/framework_graphql/conftest.py @@ -21,6 +21,7 @@ from newrelic.packages import six _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_grpc/conftest.py b/tests/framework_grpc/conftest.py index 970a096cfa..879f06602f 100644 --- a/tests/framework_grpc/conftest.py +++ b/tests/framework_grpc/conftest.py @@ -16,14 +16,16 @@ import grpc import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from testing_support.mock_external_grpc_server import MockExternalgRPCServer import newrelic.packages.six as six - _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_pyramid/conftest.py b/tests/framework_pyramid/conftest.py index 289eabeaf5..b40b5954a5 100644 --- a/tests/framework_pyramid/conftest.py +++ b/tests/framework_pyramid/conftest.py @@ -13,18 +13,20 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (framework_pyramid)', - default_settings=_default_settings) + app_name="Python Agent Test (framework_pyramid)", default_settings=_default_settings +) diff --git a/tests/framework_sanic/conftest.py b/tests/framework_sanic/conftest.py index 5152887b60..6e55569a14 100644 --- a/tests/framework_sanic/conftest.py +++ b/tests/framework_sanic/conftest.py @@ -15,15 +15,17 @@ import asyncio import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from newrelic.common.object_wrapper import ( # noqa: F401 pylint: disable=W0611 transient_function_wrapper, ) - _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_starlette/conftest.py b/tests/framework_starlette/conftest.py index 7c843cb08c..ac8d779322 100644 --- a/tests/framework_starlette/conftest.py +++ b/tests/framework_starlette/conftest.py @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 - +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_strawberry/conftest.py b/tests/framework_strawberry/conftest.py index 6345b30337..1bd7deae7f 100644 --- a/tests/framework_strawberry/conftest.py +++ b/tests/framework_strawberry/conftest.py @@ -18,6 +18,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/framework_tornado/conftest.py b/tests/framework_tornado/conftest.py index 920b916ee3..81e7f899c5 100644 --- a/tests/framework_tornado/conftest.py +++ b/tests/framework_tornado/conftest.py @@ -13,27 +13,30 @@ # limitations under the License. import pytest - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (framework_tornado)', - default_settings=_default_settings) + app_name="Python Agent Test (framework_tornado)", default_settings=_default_settings +) -@pytest.fixture(scope='module') +@pytest.fixture(scope="module") def app(request): import tornado - from tornado.testing import AsyncHTTPTestCase from _target_application import make_app + from tornado.testing import AsyncHTTPTestCase class App(AsyncHTTPTestCase): def get_app(self): @@ -45,7 +48,7 @@ def runTest(self, *args, **kwargs): @property def tornado_version(self): - return '.'.join(map(str, tornado.version_info)) + return ".".join(map(str, tornado.version_info)) case = App() case.setUp() diff --git a/tests/logger_logging/conftest.py b/tests/logger_logging/conftest.py index 63985e938f..ba8457095f 100644 --- a/tests/logger_logging/conftest.py +++ b/tests/logger_logging/conftest.py @@ -23,6 +23,7 @@ from newrelic.api.log import NewRelicLogForwardingHandler _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/logger_loguru/conftest.py b/tests/logger_loguru/conftest.py index d87f7060d0..af1fbbf841 100644 --- a/tests/logger_loguru/conftest.py +++ b/tests/logger_loguru/conftest.py @@ -21,6 +21,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/logger_structlog/conftest.py b/tests/logger_structlog/conftest.py index 22eb00f9e6..bd5bd8922e 100644 --- a/tests/logger_structlog/conftest.py +++ b/tests/logger_structlog/conftest.py @@ -22,6 +22,7 @@ from newrelic.api.transaction import current_transaction _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/messagebroker_confluentkafka/conftest.py b/tests/messagebroker_confluentkafka/conftest.py index fa86b6b3c0..576ec27f82 100644 --- a/tests/messagebroker_confluentkafka/conftest.py +++ b/tests/messagebroker_confluentkafka/conftest.py @@ -17,8 +17,10 @@ import pytest from testing_support.db_settings import kafka_settings - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from newrelic.api.transaction import current_transaction from newrelic.common.object_wrapper import transient_function_wrapper @@ -29,6 +31,7 @@ _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/messagebroker_kafkapython/conftest.py b/tests/messagebroker_kafkapython/conftest.py index de12f5830e..4a692f18ae 100644 --- a/tests/messagebroker_kafkapython/conftest.py +++ b/tests/messagebroker_kafkapython/conftest.py @@ -18,8 +18,10 @@ import kafka import pytest from testing_support.db_settings import kafka_settings - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) from newrelic.api.transaction import current_transaction from newrelic.common.object_wrapper import transient_function_wrapper @@ -31,6 +33,7 @@ _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/messagebroker_pika/conftest.py b/tests/messagebroker_pika/conftest.py index 67246f9c5f..fc682c303c 100644 --- a/tests/messagebroker_pika/conftest.py +++ b/tests/messagebroker_pika/conftest.py @@ -17,8 +17,10 @@ import pika import pytest from testing_support.db_settings import rabbitmq_settings - -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) QUEUE = "test_pika-%s" % uuid.uuid4() QUEUE_2 = "test_pika-%s" % uuid.uuid4() @@ -35,6 +37,7 @@ _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/mlmodel_langchain/conftest.py b/tests/mlmodel_langchain/conftest.py index 6012e67fcd..806528d00f 100644 --- a/tests/mlmodel_langchain/conftest.py +++ b/tests/mlmodel_langchain/conftest.py @@ -38,6 +38,7 @@ from newrelic.common.signature import bind_args _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/mlmodel_openai/conftest.py b/tests/mlmodel_openai/conftest.py index d0eb4cf8a0..54970e6f8c 100644 --- a/tests/mlmodel_openai/conftest.py +++ b/tests/mlmodel_openai/conftest.py @@ -37,6 +37,7 @@ from newrelic.common.signature import bind_args _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/mlmodel_sklearn/conftest.py b/tests/mlmodel_sklearn/conftest.py index d940a203e8..5f4a2586cb 100644 --- a/tests/mlmodel_sklearn/conftest.py +++ b/tests/mlmodel_sklearn/conftest.py @@ -13,12 +13,13 @@ # limitations under the License. from sklearn import __version__ # noqa: this is needed for get_package_version - from testing_support.fixtures import ( # noqa: F401, pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, ) + _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/mlmodel_sklearn/restats b/tests/mlmodel_sklearn/restats new file mode 100644 index 0000000000000000000000000000000000000000..04a9b6426d42138ae5691dbcdc7314f60fb7effb GIT binary patch literal 277 zcmeyZ$$X2k?j-{d{F1jxD$UF((ap?L$W1ND$WKuK^E2~`^-?QRlkGHFUoryK6|n$` zbcWK>sAD-&_UYNRG53zGm9eij&}1$G%QJxtGq8c0p`MaioS2l8s;-cqrl205Q(RD# zpQaZ8Br73P)f*T90GTIE?f?J) literal 0 HcmV?d00001 diff --git a/tests/template_genshi/conftest.py b/tests/template_genshi/conftest.py index 932ec9bae2..3d3d3a2cfd 100644 --- a/tests/template_genshi/conftest.py +++ b/tests/template_genshi/conftest.py @@ -18,6 +18,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/template_jinja2/conftest.py b/tests/template_jinja2/conftest.py index a6922078d4..ff273658fd 100644 --- a/tests/template_jinja2/conftest.py +++ b/tests/template_jinja2/conftest.py @@ -18,6 +18,7 @@ ) _default_settings = { + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. "transaction_tracer.explain_threshold": 0.0, "transaction_tracer.transaction_threshold": 0.0, "transaction_tracer.stack_trace_threshold": 0.0, diff --git a/tests/template_mako/conftest.py b/tests/template_mako/conftest.py index 623af56c0c..e389423898 100644 --- a/tests/template_mako/conftest.py +++ b/tests/template_mako/conftest.py @@ -12,17 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 + collector_agent_registration_fixture, + collector_available_fixture, +) _default_settings = { - 'transaction_tracer.explain_threshold': 0.0, - 'transaction_tracer.transaction_threshold': 0.0, - 'transaction_tracer.stack_trace_threshold': 0.0, - 'debug.log_data_collector_payloads': True, - 'debug.record_transaction_failure': True, + "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. + "transaction_tracer.explain_threshold": 0.0, + "transaction_tracer.transaction_threshold": 0.0, + "transaction_tracer.stack_trace_threshold": 0.0, + "debug.log_data_collector_payloads": True, + "debug.record_transaction_failure": True, } collector_agent_registration = collector_agent_registration_fixture( - app_name='Python Agent Test (template_mako)', - default_settings=_default_settings) - + app_name="Python Agent Test (template_mako)", default_settings=_default_settings +) From d070f5897c6c41744b32516b7fff3583c264fa86 Mon Sep 17 00:00:00 2001 From: Hannah Stepanek Date: Wed, 12 Jun 2024 14:17:24 -0700 Subject: [PATCH 2/3] Fixup: remove unused imports --- tests/adapter_cheroot/conftest.py | 1 - tests/adapter_gunicorn/conftest.py | 1 - tests/adapter_uvicorn/conftest.py | 1 - tests/agent_features/conftest.py | 5 +++-- tests/application_gearman/conftest.py | 1 - tests/component_djangorestframework/conftest.py | 1 - tests/component_flask_rest/conftest.py | 1 - tests/component_tastypie/conftest.py | 1 - tests/coroutines_asyncio/conftest.py | 6 ++++-- tests/cross_agent/conftest.py | 2 +- tests/datastore_aioredis/conftest.py | 4 +++- tests/datastore_aredis/conftest.py | 6 ++++-- tests/datastore_asyncpg/conftest.py | 4 +++- tests/datastore_bmemcached/conftest.py | 2 +- tests/datastore_psycopg2/conftest.py | 2 +- tests/datastore_psycopg2cffi/conftest.py | 2 +- tests/datastore_pylibmc/conftest.py | 2 +- tests/datastore_pymemcache/conftest.py | 2 +- tests/datastore_pymssql/conftest.py | 1 - tests/datastore_pymysql/conftest.py | 2 +- tests/datastore_pysolr/conftest.py | 1 - tests/datastore_redis/conftest.py | 2 +- tests/datastore_solrpy/conftest.py | 2 +- tests/datastore_sqlite/conftest.py | 2 +- tests/external_httpx/conftest.py | 6 +++--- tests/framework_cherrypy/conftest.py | 2 +- tests/framework_django/conftest.py | 2 +- tests/framework_pyramid/conftest.py | 2 +- 28 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/adapter_cheroot/conftest.py b/tests/adapter_cheroot/conftest.py index 34a855d9ea..891dbc5a0f 100644 --- a/tests/adapter_cheroot/conftest.py +++ b/tests/adapter_cheroot/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/adapter_gunicorn/conftest.py b/tests/adapter_gunicorn/conftest.py index 4f30485934..95bb184d3a 100644 --- a/tests/adapter_gunicorn/conftest.py +++ b/tests/adapter_gunicorn/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/adapter_uvicorn/conftest.py b/tests/adapter_uvicorn/conftest.py index 29c1c0239f..175284ba86 100644 --- a/tests/adapter_uvicorn/conftest.py +++ b/tests/adapter_uvicorn/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/agent_features/conftest.py b/tests/agent_features/conftest.py index 367be3d86f..b1d3354194 100644 --- a/tests/agent_features/conftest.py +++ b/tests/agent_features/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, @@ -54,4 +53,6 @@ "test_ml_events.py", ] else: - from testing_support.fixture.event_loop import event_loop + from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 + event_loop, + ) diff --git a/tests/application_gearman/conftest.py b/tests/application_gearman/conftest.py index 2a2c2aeb0c..83fa925600 100644 --- a/tests/application_gearman/conftest.py +++ b/tests/application_gearman/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/component_djangorestframework/conftest.py b/tests/component_djangorestframework/conftest.py index d3d527291e..8a0265dbab 100644 --- a/tests/component_djangorestframework/conftest.py +++ b/tests/component_djangorestframework/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/component_flask_rest/conftest.py b/tests/component_flask_rest/conftest.py index e8d6e8b927..7fa57c44c4 100644 --- a/tests/component_flask_rest/conftest.py +++ b/tests/component_flask_rest/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/component_tastypie/conftest.py b/tests/component_tastypie/conftest.py index cd64d6dcb1..c1bdf9a88b 100644 --- a/tests/component_tastypie/conftest.py +++ b/tests/component_tastypie/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/coroutines_asyncio/conftest.py b/tests/coroutines_asyncio/conftest.py index ccb5db4428..94726182cd 100644 --- a/tests/coroutines_asyncio/conftest.py +++ b/tests/coroutines_asyncio/conftest.py @@ -12,8 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest -from testing_support.fixture.event_loop import event_loop + +from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 + event_loop, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/cross_agent/conftest.py b/tests/cross_agent/conftest.py index 54862dd4dd..cba1ea98b0 100644 --- a/tests/cross_agent/conftest.py +++ b/tests/cross_agent/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_aioredis/conftest.py b/tests/datastore_aioredis/conftest.py index b4f8d9fd1f..57f2b79bb5 100644 --- a/tests/datastore_aioredis/conftest.py +++ b/tests/datastore_aioredis/conftest.py @@ -16,7 +16,9 @@ import pytest from testing_support.db_settings import redis_settings -from testing_support.fixture.event_loop import event_loop as loop +from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 + event_loop as loop, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_aredis/conftest.py b/tests/datastore_aredis/conftest.py index 0452e7fe63..a96484ac1d 100644 --- a/tests/datastore_aredis/conftest.py +++ b/tests/datastore_aredis/conftest.py @@ -12,8 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest -from testing_support.fixture.event_loop import event_loop as loop # noqa: F401 + +from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 + event_loop as loop, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_asyncpg/conftest.py b/tests/datastore_asyncpg/conftest.py index 800917e3e2..783e9b8462 100644 --- a/tests/datastore_asyncpg/conftest.py +++ b/tests/datastore_asyncpg/conftest.py @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from testing_support.fixture.event_loop import event_loop +from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 + event_loop, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_bmemcached/conftest.py b/tests/datastore_bmemcached/conftest.py index 128a3609ac..91149e18a5 100644 --- a/tests/datastore_bmemcached/conftest.py +++ b/tests/datastore_bmemcached/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_psycopg2/conftest.py b/tests/datastore_psycopg2/conftest.py index 832b52e123..7fe6cb7e89 100644 --- a/tests/datastore_psycopg2/conftest.py +++ b/tests/datastore_psycopg2/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_psycopg2cffi/conftest.py b/tests/datastore_psycopg2cffi/conftest.py index 96d71b3ef8..28ef3ca984 100644 --- a/tests/datastore_psycopg2cffi/conftest.py +++ b/tests/datastore_psycopg2cffi/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_pylibmc/conftest.py b/tests/datastore_pylibmc/conftest.py index 258c7cf5a6..093a522cb8 100644 --- a/tests/datastore_pylibmc/conftest.py +++ b/tests/datastore_pylibmc/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_pymemcache/conftest.py b/tests/datastore_pymemcache/conftest.py index 316b355879..22252eb9ab 100644 --- a/tests/datastore_pymemcache/conftest.py +++ b/tests/datastore_pymemcache/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_pymssql/conftest.py b/tests/datastore_pymssql/conftest.py index fc3cd17f23..70285fe136 100644 --- a/tests/datastore_pymssql/conftest.py +++ b/tests/datastore_pymssql/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_pymysql/conftest.py b/tests/datastore_pymysql/conftest.py index 86eee574a9..45d6efc895 100644 --- a/tests/datastore_pymysql/conftest.py +++ b/tests/datastore_pymysql/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_pysolr/conftest.py b/tests/datastore_pysolr/conftest.py index e5554b82c4..6886f506a8 100644 --- a/tests/datastore_pysolr/conftest.py +++ b/tests/datastore_pysolr/conftest.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_redis/conftest.py b/tests/datastore_redis/conftest.py index c00791164a..e939e15c32 100644 --- a/tests/datastore_redis/conftest.py +++ b/tests/datastore_redis/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 event_loop as loop, ) diff --git a/tests/datastore_solrpy/conftest.py b/tests/datastore_solrpy/conftest.py index de8fa5bb9c..9fa03f531f 100644 --- a/tests/datastore_solrpy/conftest.py +++ b/tests/datastore_solrpy/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/datastore_sqlite/conftest.py b/tests/datastore_sqlite/conftest.py index 328669cbe8..499dd7b9f8 100644 --- a/tests/datastore_sqlite/conftest.py +++ b/tests/datastore_sqlite/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/external_httpx/conftest.py b/tests/external_httpx/conftest.py index fcaf35835a..760e18cde1 100644 --- a/tests/external_httpx/conftest.py +++ b/tests/external_httpx/conftest.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import asyncio - import pytest -from testing_support.fixture.event_loop import event_loop as loop +from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611 + event_loop as loop, +) from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/framework_cherrypy/conftest.py b/tests/framework_cherrypy/conftest.py index 6f7832eba7..181bbcb008 100644 --- a/tests/framework_cherrypy/conftest.py +++ b/tests/framework_cherrypy/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/framework_django/conftest.py b/tests/framework_django/conftest.py index d657a22bc6..d7232bc021 100644 --- a/tests/framework_django/conftest.py +++ b/tests/framework_django/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, diff --git a/tests/framework_pyramid/conftest.py b/tests/framework_pyramid/conftest.py index b40b5954a5..ada3bf95c5 100644 --- a/tests/framework_pyramid/conftest.py +++ b/tests/framework_pyramid/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest + from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611 collector_agent_registration_fixture, collector_available_fixture, From e818420d331839beb32970fed43de7c551d387f3 Mon Sep 17 00:00:00 2001 From: Hannah Stepanek Date: Thu, 13 Jun 2024 11:17:43 -0700 Subject: [PATCH 3/3] Fixup: remove restats --- tests/mlmodel_sklearn/restats | Bin 277 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/mlmodel_sklearn/restats diff --git a/tests/mlmodel_sklearn/restats b/tests/mlmodel_sklearn/restats deleted file mode 100644 index 04a9b6426d42138ae5691dbcdc7314f60fb7effb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 277 zcmeyZ$$X2k?j-{d{F1jxD$UF((ap?L$W1ND$WKuK^E2~`^-?QRlkGHFUoryK6|n$` zbcWK>sAD-&_UYNRG53zGm9eij&}1$G%QJxtGq8c0p`MaioS2l8s;-cqrl205Q(RD# zpQaZ8Br73P)f*T90GTIE?f?J)