Skip to content

Commit 70bd112

Browse files
Add tests fmmd
1 parent f7674d9 commit 70bd112

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/test_fmmd.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pytest
12
import numpy as np
23
import tensorflow as tf
34

@@ -30,14 +31,18 @@ def test_fmmd():
3031

3132

3233
def test_kernel_fct():
34+
tf.config.experimental_run_functions_eagerly(True)
3335
fct = _get_optim_function(Xs, Xt, kernel="linear")
34-
fct(tf.identity(np.ones(6)))
35-
36+
with pytest.raises(Exception) as excinfo:
37+
fct(tf.identity(np.ones(6)))
38+
3639
fct = _get_optim_function(Xs, Xt, kernel="rbf")
37-
fct(tf.identity(np.ones(6)))
40+
with pytest.raises(Exception) as excinfo:
41+
fct(tf.identity(np.ones(6)))
3842

3943
fct = _get_optim_function(Xs, Xt, kernel="poly")
40-
fct(tf.identity(np.ones(6)))
44+
with pytest.raises(Exception) as excinfo:
45+
fct(tf.identity(np.ones(6)))
4146

4247

4348

0 commit comments

Comments
 (0)