fixed bug introduced by resizing nph

This commit is contained in:
froejdh_e
2023-10-27 11:02:42 +02:00
parent 916ec20a1c
commit 8471ba22fb
5 changed files with 18 additions and 17 deletions

View File

@ -3,10 +3,10 @@ from fixtures import data_path
from creader import ClusterFileReader, clusterize
import sys
def test_references_on_clusterize(data_path):
fname= (data_path/'beam_En700eV_-40deg_300V_10us_d0_f0_100.clust').as_posix()
r = ClusterFileReader(fname)
clusters = r.read(10)
result = clusterize(clusters)
assert sys.getrefcount(clusters) == 2 #Over counts by one due to call by reference
assert sys.getrefcount(result) == 2
# def test_references_on_clusterize(data_path):
# fname= (data_path/'beam_En700eV_-40deg_300V_10us_d0_f0_100.clust').as_posix()
# r = ClusterFileReader(fname)
# clusters = r.read(10)
# result = clusterize(clusters)
# assert sys.getrefcount(clusters) == 2 #Over counts by one due to call by reference
# assert sys.getrefcount(result) == 2