Skip to content

Commit

Permalink
adding additional fit tests
Browse files Browse the repository at this point in the history
Took 26 minutes
  • Loading branch information
tfm000 committed Sep 27, 2023
1 parent e0deb67 commit 6f881a2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sklarpy/tests/multivariate/test_prefit_dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def test_fit_to_data(mvt_continuous_data, mvt_discrete_data,
except RuntimeError:
continue

# testing fitted to correct type
assert issubclass(type(fitted), FittedContinuousMultivariate), \
f"{name} is not fitted to a child class of " \
f"FittedContinuousMultivariate."

# testing parameters object
params = fitted.params
assert issubclass(type(params), Params), \
Expand Down Expand Up @@ -104,9 +109,17 @@ def test_fit_to_data(mvt_continuous_data, mvt_discrete_data,

# testing we can fit distribution using parameters object.
params_fitted = dist.fit(params=params)
assert issubclass(type(params_fitted),
FittedContinuousMultivariate), \
f"{name} is not fitted to a child class of " \
f"FittedContinuousMultivariate."

# testing we can fit distribution using tuple object.
tuple_fitted = dist.fit(params=params.to_tuple)
assert issubclass(type(tuple_fitted),
FittedContinuousMultivariate), \
f"{name} is not fitted to a child class of " \
f"FittedContinuousMultivariate."

# testing for errors if incorrect params object provided
with pytest.raises(
Expand Down

0 comments on commit 6f881a2

Please sign in to comment.