HyukjinKwon commented on a change in pull request #32867:
URL: https://github.com/apache/spark/pull/32867#discussion_r659422401
##########
File path: dev/sparktestsupport/modules.py
##########
@@ -19,10 +19,67 @@
import itertools
import os
import re
+import unittest
+import sys
+
+from sparktestsupport import SPARK_HOME
all_modules = []
+def _get_module_from_name(name):
+ __import__(name)
+ return sys.modules[name]
+
+
+def _discover_python_unittests(*paths, discover_slow=False):
+ """Discover the python module which contains unittests under paths.
+
+ Such as:
+ ['pyspark/tests'], it will return the set of module name under the path of
pyspark/tests, like
+ {'pyspark.tests.test_appsubmit', 'pyspark.tests.test_broadcast', ...}
+
+ Parameters
+ ----------
+ paths : str
+ Paths of modules to be discovered.
+ discover_slow : bool
+ If True, will only discover slow tests
+ If False, will discover all tests except slow tests
+
+ Returns
+ -------
+ A set of complete test module name discovered under specified paths
Review comment:
It is possible to add a simple doctests at
https://github.com/apache/spark/blob/master/dev/run-tests.py? The doctests
there are ran before running the script.
--
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]