diff --git a/postgres/tests/test_statements.py b/postgres/tests/test_statements.py index 38be0bff7a51d..f8aff1a214f9a 100644 --- a/postgres/tests/test_statements.py +++ b/postgres/tests/test_statements.py @@ -18,6 +18,7 @@ from datadog_checks.base.utils.db.sql import compute_sql_signature from datadog_checks.base.utils.db.utils import DBMAsyncJob from datadog_checks.base.utils.serialization import json +from datadog_checks.base.utils.time import UTC from datadog_checks.postgres.statement_samples import DBExplainError, StatementTruncationState from datadog_checks.postgres.statements import PG_STAT_STATEMENTS_METRICS_COLUMNS, PG_STAT_STATEMENTS_TIMING_COLUMNS @@ -41,8 +42,6 @@ dbm_enabled_keys = ["dbm", "deep_database_monitoring"] -DEFAULT_TZ_INFO = psycopg2.tz.FixedOffsetTimezone(offset=0, name=None) - @pytest.fixture(autouse=True) def stop_orphaned_threads(): @@ -1023,15 +1022,15 @@ def test_activity_reported_hostname( def new_time(): - return datetime.datetime(2021, 9, 23, 23, 21, 21, 669330, tzinfo=DEFAULT_TZ_INFO) + return datetime.datetime(2021, 9, 23, 23, 21, 21, 669330, tzinfo=UTC) def old_time(): - return datetime.datetime(2021, 9, 22, 22, 21, 21, 669330, tzinfo=DEFAULT_TZ_INFO) + return datetime.datetime(2021, 9, 22, 22, 21, 21, 669330, tzinfo=UTC) def very_old_time(): - return datetime.datetime(2021, 9, 20, 23, 21, 21, 669330, tzinfo=DEFAULT_TZ_INFO) + return datetime.datetime(2021, 9, 20, 23, 21, 21, 669330, tzinfo=UTC) @pytest.mark.parametrize(