Skip to content

Commit 930367f

Browse files
committed
Address Codacy assert warnings
1 parent 718810e commit 930367f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

tests/layers/core_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def test_DNN_output_activation():
4848
x = tf.keras.layers.Input(shape=(EMBEDDING_SIZE,))
4949
y = layers.DNN((10,), output_activation='sigmoid')(x)
5050
model = tf.keras.models.Model(x, y)
51-
assert model.output_shape == (None, 10)
51+
if model.output_shape != (None, 10):
52+
raise AssertionError("Unexpected DNN output shape")
5253

5354

5455
@pytest.mark.parametrize(

tests/models/FNN_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def test_FNN_does_not_add_wide_linear_logit():
3030

3131
model = FNN(feature_columns, feature_columns, dnn_hidden_units=(4,), dnn_dropout=0)
3232

33-
assert all(layer.__class__.__name__ != 'Linear' for layer in model.layers)
33+
if not all(layer.__class__.__name__ != 'Linear' for layer in model.layers):
34+
raise AssertionError("FNN should not include a wide Linear layer")
3435

3536

3637
# @pytest.mark.parametrize(

0 commit comments

Comments
 (0)