Skip to content

Commit 491d3fc

Browse files
Pass a function handle to assertRaises
Also be more specific about the Exception we expect to see
1 parent 3344a21 commit 491d3fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/pyspark/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def test_pipe_functions(self):
878878
data = ['1', '2', '3']
879879
rdd = self.sc.parallelize(data)
880880
with QuietTest(self.sc):
881-
self.assertRaises(Exception, rdd.pipe('cc').collect())
881+
self.assertRaises(Py4JJavaError, rdd.pipe('cc').collect)
882882
result = rdd.pipe('cat').collect().sort()
883883
[self.assertEqual(x, y) for x, y in zip(data, result)]
884884

0 commit comments

Comments
 (0)