HyukjinKwon commented on code in PR #39387:
URL: https://github.com/apache/spark/pull/39387#discussion_r1064067544


##########
python/pyspark/testing/utils.py:
##########
@@ -138,6 +140,32 @@ def setUpClass(cls):
     def tearDownClass(cls):
         cls.sc.stop()
 
+    def check_error(
+        self,
+        exception: PySparkException,
+        error_class: str,
+        message_parameters: Optional[Dict[str, str]] = None,
+    ):
+        # If exception is generated as a context of assertRaises,
+        # get an actual exception from the context.
+        if isinstance(exception, unittest.case._AssertRaisesContext):
+            exception = exception.exception
+
+        # Test if given error is an instance of PySparkException.
+        assert isinstance(

Review Comment:
   can you use `self.assert...`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to