()
| 747 | |
| 748 | |
| 749 | def test_load_dumps(): |
| 750 | pool_size = (100, 10) |
| 751 | prng = np.random.RandomState(seed=20181219) |
| 752 | data = prng.randint(10, size=pool_size) |
| 753 | labels = _generate_nontrivial_binary_target(pool_size[0], prng=prng) |
| 754 | pool1 = Pool(data, labels) |
| 755 | lines = [] |
| 756 | for i in range(len(data)): |
| 757 | line = [str(labels[i])] + [str(x) for x in data[i]] |
| 758 | lines.append('\t'.join(line)) |
| 759 | text = '\n'.join(lines) |
| 760 | tmp_file = test_output_path('test_data_dumps') |
| 761 | with open(tmp_file, 'w') as f: |
| 762 | f.write(text) |
| 763 | pool2 = Pool(tmp_file) |
| 764 | assert _check_data(pool1.get_features(), pool2.get_features()) |
| 765 | assert _check_data(pool1.get_label(), [int(label) for label in pool2.get_label()]) |
| 766 | |
| 767 | |
| 768 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected