Skip to content

Commit

Permalink
[Fix] Make traditional test robust
Browse files Browse the repository at this point in the history
  • Loading branch information
franchuterivera committed May 19, 2021
1 parent c6db5be commit 0727173
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/test_api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_tabular_classification(openml_id, resampling_strategy, backend, resampl
X, y = X.iloc[:n_samples], y.iloc[:n_samples]

X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(
X, y, random_state=1)
X, y, random_state=42)

include = None
# for python less than 3.7, learned entity embedding
Expand All @@ -67,7 +67,8 @@ def test_tabular_classification(openml_id, resampling_strategy, backend, resampl
backend=backend,
resampling_strategy=resampling_strategy,
resampling_strategy_args=resampling_strategy_args,
include_components=include
include_components=include,
seed=42,
)

with unittest.mock.patch.object(estimator, '_do_dummy_prediction', new=dummy_do_dummy_prediction):
Expand Down Expand Up @@ -253,7 +254,8 @@ def test_tabular_regression(openml_name, resampling_strategy, backend, resamplin
backend=backend,
resampling_strategy=resampling_strategy,
resampling_strategy_args=resampling_strategy_args,
include_components=include
include_components=include,
seed=42,
)

with unittest.mock.patch.object(estimator, '_do_dummy_prediction', new=dummy_do_dummy_prediction):
Expand Down Expand Up @@ -513,7 +515,8 @@ def test_do_traditional_pipeline(fit_dictionary_tabular):
backend.temporary_directory, '.autoPyTorch', 'runs', f"1_{i}_50.0",
f"predictions_ensemble_1_{i}_50.0.npy"
)
assert os.path.exists(pred_path)
if not os.path.exists(pred_path):
continue

model_path = os.path.join(backend.temporary_directory,
'.autoPyTorch',
Expand Down

0 comments on commit 0727173

Please sign in to comment.