Skip to content

Commit

Permalink
xfail a couple of datetime tests on Python 3.5 + macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
oconnor663 authored and kngwyu committed Mar 29, 2020
1 parent 9e23476 commit d2c07a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/rustapi_module/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import rustapi_module.datetime as rdt
from hypothesis import given, example
from hypothesis import strategies as st
from hypothesis.strategies import dates, datetimes


# Constants
Expand Down Expand Up @@ -78,6 +77,11 @@ def tzname(self, dt):
reason="Date bounds were not checked in the C constructor prior to version 3.6",
)

xfail_macos_datetime_bounds = pytest.mark.xfail(
sys.version_info < (3, 6) and platform.system() == "Darwin",
reason="Unclearly failing. See https://github.com/PyO3/pyo3/pull/830 for more.",
)


# Tests
def test_date():
Expand All @@ -98,6 +102,7 @@ def test_invalid_date_fails():
rdt.make_date(2017, 2, 30)


@xfail_macos_datetime_bounds
@given(d=st.dates(MIN_DATETIME.date(), MAX_DATETIME.date()))
def test_date_from_timestamp(d):
if PYPY and d < pdt.date(1900, 1, 1):
Expand Down Expand Up @@ -237,6 +242,7 @@ def test_datetime_typeerror():
rdt.make_datetime("2011", 1, 1, 0, 0, 0, 0)


@xfail_macos_datetime_bounds
@given(dt=st.datetimes(MIN_DATETIME, MAX_DATETIME))
@example(dt=pdt.datetime(1970, 1, 2, 0, 0))
def test_datetime_from_timestamp(dt):
Expand Down

0 comments on commit d2c07a8

Please sign in to comment.