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:
Ralf W. Grosse-Kunstleve
2023-06-27 15:08:32 -07:00
committed by GitHub
parent e10da79b6e
commit 2fb3d7cbde
4 changed files with 54 additions and 21 deletions

View File

@@ -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