diff --git a/kratos/tests/test_container_expression.py b/kratos/tests/test_container_expression.py index 5af8d9a78512..f8f283b59948 100644 --- a/kratos/tests/test_container_expression.py +++ b/kratos/tests/test_container_expression.py @@ -753,7 +753,13 @@ def test_NormInf(self): self._Read(a, Kratos.VELOCITY) a *= -1 c = a.Evaluate().reshape([len(self._GetContainer()) * 3]) - self.assertAlmostEqual(Kratos.Expression.Utils.NormInf(a), self.data_comm.MaxAll(numpy.linalg.norm(c, ord=numpy.inf)), 9) + if c.shape == (0,): + # numpy norm inf throws an error if the array shape is zero. + # hence this is checked before. + norm_inf = 0.0 + else: + norm_inf = numpy.linalg.norm(c, ord=numpy.inf) + self.assertAlmostEqual(Kratos.Expression.Utils.NormInf(a), self.data_comm.MaxAll(norm_inf), 9) def test_NormL2(self): a = self._GetContainerExpression()