mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
test_class: use gc_collect instead of detail_reg_inst side-effect
This commit is contained in:
parent
b468a3cefc
commit
9866a0f994
@ -159,11 +159,11 @@ def test_operator_new_delete(capture):
|
|||||||
|
|
||||||
with capture:
|
with capture:
|
||||||
del a
|
del a
|
||||||
ConstructorStats.detail_reg_inst()
|
pytest.gc_collect()
|
||||||
del b
|
del b
|
||||||
ConstructorStats.detail_reg_inst()
|
pytest.gc_collect()
|
||||||
del d
|
del d
|
||||||
ConstructorStats.detail_reg_inst()
|
pytest.gc_collect()
|
||||||
assert capture == """
|
assert capture == """
|
||||||
A delete
|
A delete
|
||||||
B delete 4
|
B delete 4
|
||||||
@ -172,9 +172,9 @@ def test_operator_new_delete(capture):
|
|||||||
|
|
||||||
with capture:
|
with capture:
|
||||||
del c
|
del c
|
||||||
ConstructorStats.detail_reg_inst()
|
pytest.gc_collect()
|
||||||
del c2
|
del c2
|
||||||
ConstructorStats.detail_reg_inst()
|
pytest.gc_collect()
|
||||||
assert capture == (
|
assert capture == (
|
||||||
"C delete " + sz_noalias + "\n" +
|
"C delete " + sz_noalias + "\n" +
|
||||||
"C delete " + sz_alias + "\n"
|
"C delete " + sz_alias + "\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user