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

use struct.calcsize("P") rather than platform.machine() #830

Merged
merged 5 commits into from
Mar 29, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
xfail a couple of datetime tests on Python 3.5 + macOS
  • Loading branch information
oconnor663 authored and kngwyu committed Mar 29, 2020
commit d2c07a87d28dba50ecba08ca356f056d14fdec70
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