コード例 #1
0
ファイル: test_numpy_dtypes.py プロジェクト: wwmmqq/zmq_ops
def test_str_leak():
    from sys import getrefcount
    fmt = "f4"
    pytest.gc_collect()
    start = getrefcount(fmt)
    d = m.dtype_wrapper(fmt)
    assert d is np.dtype("f4")
    del d
    pytest.gc_collect()
    assert getrefcount(fmt) == start
コード例 #2
0
def test_str_leak():
    from sys import getrefcount
    fmt = "f4"
    pytest.gc_collect()
    start = getrefcount(fmt)
    d = m.dtype_wrapper(fmt)
    assert d is np.dtype("f4")
    del d
    pytest.gc_collect()
    assert getrefcount(fmt) == start