diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py index 9e5095734a075..4c067f970ec78 100644 --- a/python/pyspark/tests.py +++ b/python/pyspark/tests.py @@ -878,7 +878,7 @@ def test_pipe_functions(self): data = ['1', '2', '3'] rdd = self.sc.parallelize(data) with QuietTest(self.sc): - self.assertRaises(Exception, rdd.pipe('cc').collect()) + self.assertRaises(Py4JJavaError, rdd.pipe('cc').collect) result = rdd.pipe('cat').collect().sort() [self.assertEqual(x, y) for x, y in zip(data, result)]