aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/mllib/tests.py
diff options
context:
space:
mode:
authorGábor Lipták <gliptak@gmail.com>2015-10-22 15:27:11 -0700
committerDavies Liu <davies.liu@gmail.com>2015-10-22 15:27:11 -0700
commit163d53e829c166f061589cc379f61642d4c9a40f (patch)
tree72642ca829cecdaffc2c0bf8d45014b4696ef04c /python/pyspark/mllib/tests.py
parent53e83a3a77cafc2ccd0764ecdb8b3ba735bc51fc (diff)
downloadspark-163d53e829c166f061589cc379f61642d4c9a40f.tar.gz
spark-163d53e829c166f061589cc379f61642d4c9a40f.tar.bz2
spark-163d53e829c166f061589cc379f61642d4c9a40f.zip
[SPARK-7021] Add JUnit output for Python unit tests
WIP Author: Gábor Lipták <gliptak@gmail.com> Closes #8323 from gliptak/SPARK-7021.
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()