Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing timezone to be UTC for test request logger #3946

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/api/tweens/test_request_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from datetime import datetime
from datetime import timezone

import mock
import pytest
Expand Down Expand Up @@ -75,7 +76,7 @@ def test_request_logger_tween_factory_init(mock_factory):
)
def test_request_logger_tween_factory_log(mock_clog, mock_factory):
mock_factory._log(
timestamp=datetime.fromtimestamp(1589828049),
timestamp=datetime.fromtimestamp(1589828049, timezone.utc),
level="ERROR",
additional_fields={"additional_key": "additional_value"},
)
Expand All @@ -86,7 +87,7 @@ def test_request_logger_tween_factory_log(mock_clog, mock_factory):
'{"additional_key": "additional_value", '
'"cluster": "a_cluster", '
'"hostname": "a_hostname", '
'"human_timestamp": "2020-05-18T18:54:09", '
'"human_timestamp": "2020-05-18T18:54:09UTC", '
'"level": "ERROR", '
'"unix_timestamp": 1589828049.0}'
),
Expand Down
Loading