Skip to content

Commit 1a856a3

Browse files
committed
deal with callback server depreaction warnings
1 parent 1c6e1cd commit 1a856a3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

fitbit_client/auth/callback_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# fitbit_client/auth/callback_server.py
22

33
# Standard library imports
4+
from datetime import UTC
45
from datetime import datetime
56
from datetime import timedelta
67
from http.server import HTTPServer
@@ -106,8 +107,8 @@ def start(self) -> None:
106107
.issuer_name(issuer)
107108
.public_key(private_key.public_key())
108109
.serial_number(x509.random_serial_number())
109-
.not_valid_before(datetime.utcnow())
110-
.not_valid_after(datetime.utcnow() + timedelta(days=10))
110+
.not_valid_before(datetime.now(UTC))
111+
.not_valid_after(datetime.now(UTC) + timedelta(days=10))
111112
.add_extension(
112113
x509.SubjectAlternativeName([x509.DNSName(self.host)]), critical=False
113114
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extensions = [
7777
testpaths = ["tests"]
7878
minversion = 6.0
7979
python_files = "test_*.py"
80-
addopts = "-ra -q --cov=fitbit_client --cache-clear --cov-report=term-missing --cov-report=html:_cov_html -v --tb=native"
80+
addopts = "-ra -q --cov=fitbit_client --cache-clear --cov-report=term-missing --tb=native -W error::DeprecationWarning"
8181
pythonpath = ["."]
8282

8383
# https://pytest-cov.readthedocs.io/en/latest/config.html

0 commit comments

Comments
 (0)