diff options
author | Henry Schreiner <henryschreineriii@gmail.com> | 2020-07-22 10:18:41 -0400 |
---|---|---|
committer | Henry Schreiner <HenrySchreinerIII@gmail.com> | 2020-07-23 17:42:53 -0400 |
commit | ef057f12b65a48c91def4efe854123618271eb77 (patch) | |
tree | 5c975d0399267f24da416f16b27febbd7669a7d5 /tests | |
parent | 134a2ec3f7affc808f8ba19ae5734bb8a47b1c30 (diff) | |
download | platform_external_python_pybind11-ef057f12b65a48c91def4efe854123618271eb77.tar.gz platform_external_python_pybind11-ef057f12b65a48c91def4efe854123618271eb77.tar.bz2 platform_external_python_pybind11-ef057f12b65a48c91def4efe854123618271eb77.zip |
test: support pypy2 7.3
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_kwargs_and_defaults.py | 7 | ||||
-rw-r--r-- | tests/test_pytypes.py | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_kwargs_and_defaults.py b/tests/test_kwargs_and_defaults.py index 6c72a93..531a9fd 100644 --- a/tests/test_kwargs_and_defaults.py +++ b/tests/test_kwargs_and_defaults.py @@ -2,6 +2,11 @@ import pytest from pybind11_tests import kwargs_and_defaults as m +import platform +import sys + +pypy = platform.python_implementation() == "PyPy" + def test_function_signatures(doc): assert doc(m.kw_func0) == "kw_func0(arg0: int, arg1: int) -> str" @@ -146,6 +151,8 @@ def test_keyword_only_args(msg): """ +@pytest.mark.xfail(pypy and sys.version_info < (3, 0), + reason="PyPy2 doesn't seem to double count") def test_args_refcount(): """Issue/PR #1216 - py::args elements get double-inc_ref()ed when combined with regular arguments""" diff --git a/tests/test_pytypes.py b/tests/test_pytypes.py index 5d2ccf8..4cfc707 100644 --- a/tests/test_pytypes.py +++ b/tests/test_pytypes.py @@ -322,7 +322,8 @@ def test_memoryview_from_buffer_empty_shape(): assert view.format == 'B' if sys.version_info.major < 3: # Python 2 behavior is weird, but Python 3 (the future) is fine. - assert bytes(view).startswith(b'<memory at ') + # PyPy3 has <memoryview, while CPython 2 has <memory + assert bytes(view).startswith(b'<memory') else: assert bytes(view) == b'' |