コード例 #1
0
def test_lambda_closure_cleanup():
    from pybind11_tests import test_cleanup, payload_cstats

    test_cleanup()
    cstats = payload_cstats()
    assert cstats.alive() == 0
    assert cstats.copy_constructions == 1
    assert cstats.move_constructions >= 1
コード例 #2
0
def test_lambda_closure_cleanup():
    from pybind11_tests import test_cleanup, payload_cstats

    test_cleanup()
    cstats = payload_cstats()
    assert cstats.alive() == 0
    assert cstats.copy_constructions == 1
    assert cstats.move_constructions >= 1
コード例 #3
0
def test_lambda_closure_cleanup():
    from pybind11_tests import test_cleanup, payload_cstats

    test_cleanup()
    cstats = payload_cstats()
    if cstats.alive() != 0:
        raise AssertionError
    if cstats.copy_constructions != 1:
        raise AssertionError
    if cstats.move_constructions < 1:
        raise AssertionError