Compare commits

..

1 Commits

Author SHA1 Message Date
Rory Flynn
9c2627fa79
Merge 6bb47757e1 into 6c7ad0ac95 2024-04-18 16:52:57 +02:00
3 changed files with 9 additions and 8 deletions

View File

@ -40,9 +40,7 @@ jobs:
- name: Safety checks
run: safety check
- name: Test with pytest and coverage
run: |
set -o pipefail
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=mvt tests/ | tee pytest-coverage.txt
run: pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=mvt tests/ | tee pytest-coverage.txt
- name: Pytest coverage comment
continue-on-error: true # Workflows running on a fork can't post comments
uses: MishaKav/pytest-coverage-comment@main

View File

@ -59,10 +59,13 @@ def convert_datetime_to_iso(date_time: datetime.datetime) -> str:
:rtype: str
"""
if date_time.tzinfo:
# Timezone aware object - convert to UTC
date_time = date_time.astimezone(tz=datetime.timezone.utc)
return date_time.strftime("%Y-%m-%d %H:%M:%S.%f")
try:
if date_time.tzinfo:
# Timezone aware object - convert to UTC
date_time = date_time.astimezone(tz=datetime.UTC)
return date_time.strftime("%Y-%m-%d %H:%M:%S.%f")
except Exception:
return ""
def convert_unix_to_utc_datetime(

View File

@ -3,4 +3,4 @@
# Use of this software is governed by the MVT License 1.1 that can be found at
# https://license.mvt.re/1.1/
MVT_VERSION = "2.5.2"
MVT_VERSION = "2.5.1"