From f4ec09bc6a129eac59b750d9877773fef9dd9d8c Mon Sep 17 00:00:00 2001 From: Dmitry Orlov Date: Mon, 15 Jan 2024 14:43:03 +0100 Subject: [PATCH] fix timezone in test --- poetry.lock | 18 +++++++++++++++++- pyproject.toml | 1 + tests/test_amqp.py | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index eb6d8b81..7c5a2413 100644 --- a/poetry.lock +++ b/poetry.lock @@ -962,6 +962,22 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] +[[package]] +name = "setuptools" +version = "69.0.3" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "setuptools-69.0.3-py3-none-any.whl", hash = "sha256:385eb4edd9c9d5c17540511303e39a147ce2fc04bc55289c322b9e5904fe2c05"}, + {file = "setuptools-69.0.3.tar.gz", hash = "sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + [[package]] name = "shortuuid" version = "1.0.11" @@ -1416,4 +1432,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "bd411dacd4fe2b66602dfbe52c77c6cf06575c6f6c6a4c0ff3e9655281996db1" +content-hash = "1ee9dbc60681baa3c67eabfc8290e3e67d2266e2080b9c62ae888cf4a0dc6e43" diff --git a/pyproject.toml b/pyproject.toml index ad251e34..ff5dd069 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ sphinx = "^5.3.0" sphinx-autobuild = "^2021.3.14" timeout-decorator = "^0.5.0" types-setuptools = "^65.6.0.2" +setuptools = "^69.0.3" [tool.poetry.group.uvloop.dependencies] uvloop = "^0.17.0" diff --git a/tests/test_amqp.py b/tests/test_amqp.py index 0c95e655..33ddb1ca 100644 --- a/tests/test_amqp.py +++ b/tests/test_amqp.py @@ -3,7 +3,7 @@ import os import time import uuid -from datetime import datetime +from datetime import datetime, timezone from typing import Callable, Optional from unittest import mock @@ -369,7 +369,7 @@ async def test_incoming_message_info( message_id=shortuuid.uuid(), priority=0, reply_to="test", - timestamp=datetime.utcfromtimestamp(int(time.time())), + timestamp=datetime.fromtimestamp(int(time.time()), tz=timezone.utc), type="0", user_id="guest", )