Skip to content
Snippets Groups Projects
Commit 2415c18f authored by Josh Rosen's avatar Josh Rosen
Browse files

Fix reporting of PySpark doctest failures.

parent ae26911e
No related branches found
No related tags found
No related merge requests found
...@@ -256,8 +256,10 @@ def _test(): ...@@ -256,8 +256,10 @@ def _test():
globs['sc'] = SparkContext('local[4]', 'PythonTest', batchSize=2) globs['sc'] = SparkContext('local[4]', 'PythonTest', batchSize=2)
globs['tempdir'] = tempfile.mkdtemp() globs['tempdir'] = tempfile.mkdtemp()
atexit.register(lambda: shutil.rmtree(globs['tempdir'])) atexit.register(lambda: shutil.rmtree(globs['tempdir']))
doctest.testmod(globs=globs) (failure_count, test_count) = doctest.testmod(globs=globs)
globs['sc'].stop() globs['sc'].stop()
if failure_count:
exit(-1)
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -748,8 +748,10 @@ def _test(): ...@@ -748,8 +748,10 @@ def _test():
# The small batch size here ensures that we see multiple batches, # The small batch size here ensures that we see multiple batches,
# even in these small test examples: # even in these small test examples:
globs['sc'] = SparkContext('local[4]', 'PythonTest', batchSize=2) globs['sc'] = SparkContext('local[4]', 'PythonTest', batchSize=2)
doctest.testmod(globs=globs) (failure_count, test_count) = doctest.testmod(globs=globs)
globs['sc'].stop() globs['sc'].stop()
if failure_count:
exit(-1)
if __name__ == "__main__": if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment