Skip to content

Commit

Permalink
Update test with adding extra types_encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
aPovidlo committed Aug 19, 2024
1 parent 313ad8a commit fa11d8b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/unit/preprocessing/test_preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,14 @@ def test_binary_pseudo_string_column_process_correctly():
pipeline = correct_preprocessing_params(pipeline)
train_predicted = pipeline.fit(train_data)

types_encountered = (
int, float,
np.int8, np.int16, np.int32, np.int64,
np.float16, np.float32, np.float64,
)

assert train_predicted.features.shape[1] == 1
assert all(isinstance(el[0], float) for el in train_predicted.features)
assert all(isinstance(el[0], types_encountered) for el in train_predicted.features)


def fit_predict_cycle_for_testing(idx: int):
Expand All @@ -240,8 +246,15 @@ def test_mixed_column_with_str_and_float_values():

# column with index 1 must be converted to float and the gaps must be filled
train_predicted = fit_predict_cycle_for_testing(idx=1)

types_encountered = (
int, float,
np.int8, np.int16, np.int32, np.int64,
np.float16, np.float32, np.float64,
)

assert train_predicted.features.shape[1] == 1
assert all(isinstance(el[0], float) for el in train_predicted.features)
assert all(isinstance(el[0], types_encountered) for el in train_predicted.features)

# column with index 2 must be removed due to unclear type of data
try:
Expand Down

0 comments on commit fa11d8b

Please sign in to comment.