Skip to content

Commit

Permalink
excluded failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Apr 19, 2021
1 parent b73a835 commit 127c500
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_time_conversions.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import pytest
from datetime import datetime

from pendulum import DateTime, UTC, from_timestamp, instance

from eascheduler.const import local_tz

berlin_tz = str(local_tz) == "Timezone('Europe/Berlin')"


@pytest.mark.skipif(not berlin_tz, reason='Test only works in time zone Europe/Berlin')
def test_to_timestamp():
# Timestamps are always in UTC
assert DateTime(2001, 1, 1, 12, tzinfo=local_tz).timestamp() == 978346800
assert DateTime(2001, 1, 1, 11, tzinfo=UTC).timestamp() == 978346800


@pytest.mark.skipif(not berlin_tz, reason='Test only works in time zone Europe/Berlin')
def test_from_timestamp():
# Loading from timestamps always works correct
assert from_timestamp(978346800, tz=local_tz) == DateTime(2001, 1, 1, 12, tzinfo=local_tz)
assert from_timestamp(978346800, tz=UTC) == DateTime(2001, 1, 1, 11, tzinfo=UTC)


@pytest.mark.skipif(not berlin_tz, reason='Test only works in time zone Europe/Berlin')
def test_from_instance():
dt = datetime(2001, 1, 1, 12)

Expand Down

0 comments on commit 127c500

Please sign in to comment.