mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Trivial refactoring to make the capsule API more user friendly. (#4720)
* Trivial refactoring to make the capsule API more user friendly. * Use new API in production code. Thanks @Lalaland for pointing this out.
This commit is contained in:
committed by
GitHub
parent
e10da79b6e
commit
2fb3d7cbde
@@ -319,6 +319,19 @@ def test_capsule(capture):
|
||||
"""
|
||||
)
|
||||
|
||||
with capture:
|
||||
a = m.return_capsule_with_destructor_3()
|
||||
del a
|
||||
pytest.gc_collect()
|
||||
assert (
|
||||
capture.unordered
|
||||
== """
|
||||
creating capsule
|
||||
destructing capsule: 1233
|
||||
original name: oname
|
||||
"""
|
||||
)
|
||||
|
||||
with capture:
|
||||
a = m.return_renamed_capsule_with_destructor_2()
|
||||
del a
|
||||
|
||||
Reference in New Issue
Block a user