5875ede5ebfc7e2d46c8d8714e87c11a84ad5d39,tests/utils/test_utils.py,,test_calculate_object_size,#,68
Before Change
elems.append(np.ones((array_length), np.int8))
elems.append("testing_string")
if sys.platform == "linux":
// assert sizes based on a linux system
assert calculate_object_size(elems, "byte") == 37335
assert calculate_object_size(elems, "kB") == 36.4599609375
assert calculate_object_size(elems, "MB") == 0.035605430603027344
else:
// run for coverage
calculate_object_size(elems, "byte")
calculate_object_size(elems, "kB")
calculate_object_size(elems, "MB")
def test_add_dict_values():
a = {0: 1, 2: 1}
b = {1: 1, 2: 1, 3: 0}
After Change
np.isclose(calculate_object_size(elems, "byte"), expected_size_in_bytes_3)
else:
// only run for coverage
calculate_object_size(elems, "byte")
// Run for coverage the "kB" and "MB" variants.
// No asert is needed since they are based on the "byte" size.
calculate_object_size(elems, "kB")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: scikit-multiflow/scikit-multiflow
Commit Name: 5875ede5ebfc7e2d46c8d8714e87c11a84ad5d39
Time: 2020-02-28
Author: 17923265+jacobmontiel@users.noreply.github.com
File Name: tests/utils/test_utils.py
Class Name:
Method Name: test_calculate_object_size