Skip to content

Commit 380b0d5

Browse files
Albert Alonsofmfn
authored andcommitted
Change assertion exceptio to TypeError
1 parent 35a966a commit 380b0d5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bayes_opt/bayesian_optimization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def __init__(self, f, pbounds, random_state=None, verbose=2,
126126
try:
127127
self._bounds_transformer.initialize(self._space)
128128
except (AttributeError, TypeError):
129-
raise AssertionError('The transformer must be instance of'
130-
'DomainTransformer')
129+
raise TypeError('The transformer must be an instance of '
130+
'DomainTransformer')
131131

132132
super(BayesianOptimization, self).__init__(events=DEFAULT_EVENTS)
133133

tests/test_bayesian_optimization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def reset(self):
293293

294294

295295
def test_define_wrong_transformer():
296-
with pytest.raises(AssertionError):
296+
with pytest.raises(TypeError):
297297
optimizer = BayesianOptimization(target_func, PBOUNDS,
298298
random_state=np.random.RandomState(1),
299299
bounds_transformer=3)

0 commit comments

Comments
 (0)