From 258f5f64b0a8159e9a7dc6c420c0a56e5ac1b184 Mon Sep 17 00:00:00 2001 From: Israel Fruchter Date: Tue, 25 Jun 2024 00:24:51 +0300 Subject: [PATCH] fix several deprecation warnings adding -Werror flag to pytest configuration so we can flush all of those with the test we have so we won't have user of the driver running into those and get them fixed address as soon as we support new python versions --- cassandra/util.py | 2 +- pytest.ini | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cassandra/util.py b/cassandra/util.py index dd5c58b01d..486284a058 100644 --- a/cassandra/util.py +++ b/cassandra/util.py @@ -34,7 +34,7 @@ from cassandra import DriverException DATETIME_EPOC = datetime.datetime(1970, 1, 1) -UTC_DATETIME_EPOC = datetime.datetime.utcfromtimestamp(0) +UTC_DATETIME_EPOC = datetime.datetime.fromtimestamp(0, tz=datetime.timezone.utc) _nan = float('nan') diff --git a/pytest.ini b/pytest.ini index 0846273427..5380b333bb 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,3 +3,9 @@ log_format = %(asctime)s.%(msecs)03d %(levelname)s [%(module)s:%(lineno)s]: %(me log_level = DEBUG log_date_format = %Y-%m-%d %H:%M:%S xfail_strict=true + + +addopts = + -Werror + -W'ignore::pytest.PytestCollectionWarning' + -W'ignore:distutils Version classes are deprecated:DeprecationWarning:eventlet.support.greenlets'