From 491d3fcc4b15ffa5c18b74896107afc8a27f20c8 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 18 Jun 2015 17:28:55 +0100 Subject: [PATCH] Pass a function handle to assertRaises Also be more specific about the Exception we expect to see --- python/pyspark/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)]