aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/mllib/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyspark/mllib/tests.py')
-rw-r--r--python/pyspark/mllib/tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/python/pyspark/mllib/tests.py b/python/pyspark/mllib/tests.py
index 2ad69a0ab1..f8e8e0e0ad 100644
--- a/python/pyspark/mllib/tests.py
+++ b/python/pyspark/mllib/tests.py
@@ -31,6 +31,10 @@ from numpy import (
from numpy import sum as array_sum
from py4j.protocol import Py4JJavaError
+try:
+ import xmlrunner
+except ImportError:
+ xmlrunner = None
if sys.version > '3':
basestring = str
@@ -1538,7 +1542,10 @@ class MLUtilsTests(MLlibTestCase):
if __name__ == "__main__":
if not _have_scipy:
print("NOTE: Skipping SciPy tests as it does not seem to be installed")
- unittest.main()
+ if xmlrunner:
+ unittest.main(testRunner=xmlrunner.XMLTestRunner(output='target/test-reports'))
+ else:
+ unittest.main()
if not _have_scipy:
print("NOTE: SciPy tests were skipped as it does not seem to be installed")
sc.stop()