Skip to content

Commit

Permalink
bugfix: install test
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusTorrado committed May 17, 2022
1 parent ca938e7 commit 5844cfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cobaya/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def check_kind_and_return(cls):
"""
if kind is not None:
if not issubclass(cls, get_base_classes()[kind]):
raise TypeError("Class %r is not a standard class type %r", name, kinds)
raise TypeError(f"Class '{name}' is not a standard class of type {kind}.")
return cls

def check_if_ComponentNotFoundError_and_raise(_excpt, not_found_msg=_not_found_msg,
Expand Down
7 changes: 3 additions & 4 deletions tests/test_cosmo_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from getdist.mcsamples import MCSamplesFromCobaya, loadMCSamples
from cobaya import mpi, run, Theory, InputDict, PostDict, LoggedError
from cobaya.conventions import Extension
from cobaya.component import ComponentNotFoundError
from cobaya.tools import deepcopy_where_possible
from cobaya.cosmo_input.convert_cosmomc import cosmomc_root_to_cobaya_info_dict
from cobaya.log import NoLogging
Expand Down Expand Up @@ -72,14 +73,12 @@ def test_cosmo_run_not_found():
with NoLogging(logging.ERROR):
inf = deepcopy_where_possible(info)
inf["likelihood"]["H0.perfect"] = None
with pytest.raises(LoggedError) as e:
with pytest.raises(ComponentNotFoundError):
run(inf)
assert "Failed to get defaults for component" in str(e)
inf = deepcopy_where_possible(info)
inf["likelihood"]["none"] = None
with pytest.raises(LoggedError) as e:
with pytest.raises(ComponentNotFoundError):
run(inf)
assert "Failed to get defaults for component" in str(e)
inf = deepcopy_where_possible(info)
inf["likelihood"]["pandas.plotting.PlotAccessor"] = None
with pytest.raises(LoggedError) as e:
Expand Down

0 comments on commit 5844cfa

Please sign in to comment.