diff --git a/tests/adapter_asgiref/conftest.py b/tests/adapter_asgiref/conftest.py index e35068861..e840a574a 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 37d9d4df4..891dbc5a0 100644 --- a/tests/adapter_cheroot/conftest.py +++ b/tests/adapter_cheroot/conftest.py @@ -12,19 +12,20 @@ # See the License for the specific language governing permissions and # 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 3b35b2ee6..6ee940fbb 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 01dacc9e6..41abbb7f4 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 228742c96..95bb184d3 100644 --- a/tests/adapter_gunicorn/conftest.py +++ b/tests/adapter_gunicorn/conftest.py @@ -12,18 +12,20 @@ # See the License for the specific language governing permissions and # 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 2276e9415..e6311a88d 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 4f2f7c2df..175284ba8 100644 --- a/tests/adapter_uvicorn/conftest.py +++ b/tests/adapter_uvicorn/conftest.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # 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 aecbfd86d..e9024469d 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 b8c8972d3..b1d335419 100644 --- a/tests/agent_features/conftest.py +++ b/tests/agent_features/conftest.py @@ -12,17 +12,18 @@ # See the License for the specific language governing permissions and # 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 +31,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( @@ -52,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/agent_streaming/conftest.py b/tests/agent_streaming/conftest.py index 390aeda9c..a88d47828 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 1504d1b8d..fd5630f81 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 d0a38fa35..90bc93c71 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 6a38806e2..83fa92560 100644 --- a/tests/application_gearman/conftest.py +++ b/tests/application_gearman/conftest.py @@ -12,19 +12,20 @@ # See the License for the specific language governing permissions and # 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 a4b37571d..8a0265dba 100644 --- a/tests/component_djangorestframework/conftest.py +++ b/tests/component_djangorestframework/conftest.py @@ -12,20 +12,21 @@ # See the License for the specific language governing permissions and # 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 ff00973ab..7fa57c44c 100644 --- a/tests/component_flask_rest/conftest.py +++ b/tests/component_flask_rest/conftest.py @@ -12,20 +12,21 @@ # See the License for the specific language governing permissions and # 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 f62af8210..26613da4f 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 e38e3b2f3..c1bdf9a88 100644 --- a/tests/component_tastypie/conftest.py +++ b/tests/component_tastypie/conftest.py @@ -12,20 +12,21 @@ # See the License for the specific language governing permissions and # 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 5d3d843d0..94726182c 100644 --- a/tests/coroutines_asyncio/conftest.py +++ b/tests/coroutines_asyncio/conftest.py @@ -12,13 +12,17 @@ # 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.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +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, +) _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 d21ebf236..cba1ea98b 100644 --- a/tests/cross_agent/conftest.py +++ b/tests/cross_agent/conftest.py @@ -12,20 +12,22 @@ # See the License for the specific language governing permissions and # 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 e1cea4c01..57f2b79bb 100644 --- a/tests/datastore_aioredis/conftest.py +++ b/tests/datastore_aioredis/conftest.py @@ -13,13 +13,18 @@ # 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 ( # 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, +) -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 newrelic.common.package_version_utils import get_package_version_tuple try: import aioredis @@ -38,6 +43,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 +69,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 78067e0fe..a96484ac1 100644 --- a/tests/datastore_aredis/conftest.py +++ b/tests/datastore_aredis/conftest.py @@ -12,21 +12,26 @@ # 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.fixtures import collector_agent_registration_fixture, collector_available_fixture # 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_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 69bc0501a..783e9b846 100644 --- a/tests/datastore_asyncpg/conftest.py +++ b/tests/datastore_asyncpg/conftest.py @@ -12,11 +12,16 @@ # 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.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611 +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, +) _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 c970c1c34..91149e18a 100644 --- a/tests/datastore_bmemcached/conftest.py +++ b/tests/datastore_bmemcached/conftest.py @@ -12,20 +12,23 @@ # See the License for the specific language governing permissions and # 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 53fa6fcdc..4377112e6 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 28e138fa2..ca54a0838 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 835e895bd..7812cea26 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 a2f74c398..bc241617d 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 4a25f2574..545de0f7d 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 4a066086e..dd6a174d9 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 dd271909d..7fe6cb7e8 100644 --- a/tests/datastore_psycopg2/conftest.py +++ b/tests/datastore_psycopg2/conftest.py @@ -12,21 +12,24 @@ # See the License for the specific language governing permissions and # 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 c9df1369b..28ef3ca98 100644 --- a/tests/datastore_psycopg2cffi/conftest.py +++ b/tests/datastore_psycopg2cffi/conftest.py @@ -12,21 +12,24 @@ # See the License for the specific language governing permissions and # 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 40970bdca..093a522cb 100644 --- a/tests/datastore_pylibmc/conftest.py +++ b/tests/datastore_pylibmc/conftest.py @@ -12,20 +12,23 @@ # See the License for the specific language governing permissions and # 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 3d4e1ce76..22252eb9a 100644 --- a/tests/datastore_pymemcache/conftest.py +++ b/tests/datastore_pymemcache/conftest.py @@ -12,20 +12,23 @@ # See the License for the specific language governing permissions and # 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 d269182b0..057957832 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 a6584cdff..70285fe13 100644 --- a/tests/datastore_pymssql/conftest.py +++ b/tests/datastore_pymssql/conftest.py @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # 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 51d037432..45d6efc89 100644 --- a/tests/datastore_pymysql/conftest.py +++ b/tests/datastore_pymysql/conftest.py @@ -12,21 +12,24 @@ # See the License for the specific language governing permissions and # 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 b00a0a663..dd646b062 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 07851b698..6886f506a 100644 --- a/tests/datastore_pysolr/conftest.py +++ b/tests/datastore_pysolr/conftest.py @@ -12,20 +12,22 @@ # See the License for the specific language governing permissions and # 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 6747039b4..e939e15c3 100644 --- a/tests/datastore_redis/conftest.py +++ b/tests/datastore_redis/conftest.py @@ -12,21 +12,26 @@ # See the License for the specific language governing permissions and # 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 fe53f1fe2..424ffc6f6 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 4418e5d9a..9fa03f531 100644 --- a/tests/datastore_solrpy/conftest.py +++ b/tests/datastore_solrpy/conftest.py @@ -12,20 +12,23 @@ # See the License for the specific language governing permissions and # 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 ed695b251..499dd7b9f 100644 --- a/tests/datastore_sqlite/conftest.py +++ b/tests/datastore_sqlite/conftest.py @@ -12,21 +12,24 @@ # See the License for the specific language governing permissions and # 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 558167ec2..2c54daf31 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 3ac192003..026ece768 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 11d19f1cd..136cfa878 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 f8afb49f3..5d1822249 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 2edbeab91..729523599 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 cf3501da5..55797d84a 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 87ea1bec0..760e18cde 100644 --- a/tests/external_httpx/conftest.py +++ b/tests/external_httpx/conftest.py @@ -12,14 +12,17 @@ # 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.fixtures import collector_agent_registration_fixture, collector_available_fixture # 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 = { + "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 10a2ccf05..15426c3a5 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 19d3f394b..e380eda1b 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 3bb814a9b..317383f0c 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 7bc5153eb..e9de51e7d 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 095a3331f..5e3098370 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 bc730bb1f..181bbcb00 100644 --- a/tests/framework_cherrypy/conftest.py +++ b/tests/framework_cherrypy/conftest.py @@ -12,19 +12,21 @@ # See the License for the specific language governing permissions and # 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 8a43ef5c9..d7232bc02 100644 --- a/tests/framework_django/conftest.py +++ b/tests/framework_django/conftest.py @@ -12,21 +12,23 @@ # See the License for the specific language governing permissions and # 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 fd43715c6..8b781fed0 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 d65398ffb..e53e59706 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 f90ed9b51..428b984c2 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 7a6f88554..12f69f5a3 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 5302da2b8..fdf1bf5cf 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 970a096cf..879f06602 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 289eabeaf..ada3bf95c 100644 --- a/tests/framework_pyramid/conftest.py +++ b/tests/framework_pyramid/conftest.py @@ -12,19 +12,21 @@ # See the License for the specific language governing permissions and # 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 5152887b6..6e55569a1 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 7c843cb08..ac8d77932 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 6345b3033..1bd7deae7 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 920b916ee..81e7f899c 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 63985e938..ba8457095 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 d87f7060d..af1fbbf84 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 22eb00f9e..bd5bd8922 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 fa86b6b3c..576ec27f8 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 de12f5830..4a692f18a 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 67246f9c5..fc682c303 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 6012e67fc..806528d00 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 d0eb4cf8a..54970e6f8 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 d940a203e..5f4a2586c 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/template_genshi/conftest.py b/tests/template_genshi/conftest.py index 932ec9bae..3d3d3a2cf 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 a6922078d..ff273658f 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 623af56c0..e38942389 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 +)