Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21107#discussion_r183237998
  
    --- Diff: python/pyspark/ml/tests.py ---
    @@ -2136,17 +2136,23 @@ class ImageReaderTest2(PySparkTestCase):
         @classmethod
         def setUpClass(cls):
             super(ImageReaderTest2, cls).setUpClass()
    +        cls.hive_available = True
             # Note that here we enable Hive's support.
             cls.spark = None
             try:
                 cls.sc._jvm.org.apache.hadoop.hive.conf.HiveConf()
             except py4j.protocol.Py4JError:
                 cls.tearDownClass()
    -            raise unittest.SkipTest("Hive is not available")
    +            cls.hive_available = False
             except TypeError:
                 cls.tearDownClass()
    -            raise unittest.SkipTest("Hive is not available")
    -        cls.spark = HiveContext._createForTesting(cls.sc)
    +            cls.hive_available = False
    +        if cls.hive_available:
    +            cls.spark = HiveContext._createForTesting(cls.sc)
    +
    +    def setUp(self):
    +        if not self.hive_available:
    +            self.skipTest("Hive is not available.")
    --- End diff --
    
    A little worry that it can be too verbose when skipped tests are too many. 
See https://github.com/apache/spark/pull/21107#discussion_r183237963.


---

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

Reply via email to