Skip to content

Commit ad700fe

Browse files
committed
PyPy compatibility.
1 parent 0dcef2a commit ad700fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_pickling_trampoline.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# -*- coding: utf-8 -*-
22
import pytest
33

4+
import env # noqa: F401
5+
46
from pybind11_tests import pickling_trampoline as m
57

68
try:
@@ -26,9 +28,10 @@ def test_roundtrip_simple_py_derived():
2628
def test_roundtrip_simple_cpp_derived():
2729
p = m.make_SimpleCppDerivedAsBase()
2830
p.num = 404
29-
with pytest.raises(AttributeError):
30-
# To ensure that future changes do not accidentally invalidate this unit test.
31-
p.__dict__
31+
if not env.PYPY:
32+
with pytest.raises(AttributeError):
33+
# To ensure that future changes do not accidentally invalidate this unit test.
34+
p.__dict__
3235
data = pickle.dumps(p, pickle.HIGHEST_PROTOCOL)
3336
p2 = pickle.loads(data)
3437
assert p2.num == 404

0 commit comments

Comments
 (0)