Skip to content

Commit

Permalink
Small bugfixes for errors on test cleanup (#851)
Browse files Browse the repository at this point in the history
* explicitly close fake_trained_model DB session to avoid exception on test cleanup

* close experiments test session
  • Loading branch information
shaycrk authored Jul 5, 2021
1 parent 700040b commit fa8d576
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/tests/test_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,4 @@ def test_experiment_metadata(finished_experiment):
assert experiment_row.matrices_needed == experiment_row.time_splits * 2 * experiment_row.feature_group_combinations # x2 for train and test
assert experiment_row.grid_size == 4
assert experiment_row.models_needed == (experiment_row.matrices_needed/2) * experiment_row.grid_size # /2 because we only need models per train matrix
session.close()
4 changes: 3 additions & 1 deletion src/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def fake_trained_model(
)
session.add(db_model)
session.commit()
return trained_model, db_model.model_id
model_id = db_model.model_id
session.close()
return trained_model, model_id


def matrix_metadata_creator(**override_kwargs):
Expand Down

0 comments on commit fa8d576

Please sign in to comment.