mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
test: support pypy2 7.3
This commit is contained in:
parent
134a2ec3f7
commit
ef057f12b6
@ -2,6 +2,11 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from pybind11_tests import kwargs_and_defaults as m
|
from pybind11_tests import kwargs_and_defaults as m
|
||||||
|
|
||||||
|
import platform
|
||||||
|
import sys
|
||||||
|
|
||||||
|
pypy = platform.python_implementation() == "PyPy"
|
||||||
|
|
||||||
|
|
||||||
def test_function_signatures(doc):
|
def test_function_signatures(doc):
|
||||||
assert doc(m.kw_func0) == "kw_func0(arg0: int, arg1: int) -> str"
|
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():
|
def test_args_refcount():
|
||||||
"""Issue/PR #1216 - py::args elements get double-inc_ref()ed when combined with regular
|
"""Issue/PR #1216 - py::args elements get double-inc_ref()ed when combined with regular
|
||||||
arguments"""
|
arguments"""
|
||||||
|
@ -322,7 +322,8 @@ def test_memoryview_from_buffer_empty_shape():
|
|||||||
assert view.format == 'B'
|
assert view.format == 'B'
|
||||||
if sys.version_info.major < 3:
|
if sys.version_info.major < 3:
|
||||||
# Python 2 behavior is weird, but Python 3 (the future) is fine.
|
# 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:
|
else:
|
||||||
assert bytes(view) == b''
|
assert bytes(view) == b''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user