Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix lazy logging warnings in Prospector checks
  • Loading branch information
JoshRosen committed Jun 28, 2015
commit 866b5b9948309b48928f0b1c1d74a043c34119f2
12 changes: 6 additions & 6 deletions python/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def print_red(text):

def run_individual_python_test(test_name, pyspark_python):
env = {'SPARK_TESTING': '1', 'PYSPARK_PYTHON': which(pyspark_python)}
LOGGER.info("Starting test(%s): %s" % (pyspark_python, test_name))
LOGGER.info("Starting test(%s): %s", pyspark_python, test_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could remove this line, to not having them interleaved.

start_time = time.time()
per_test_output = tempfile.TemporaryFile()
retcode = subprocess.Popen(
Expand All @@ -79,7 +79,7 @@ def run_individual_python_test(test_name, pyspark_python):
# this code is invoked from a thread other than the main thread.
os._exit(-1)
else:
LOGGER.info("Finished test(%s): %s (%is)" % (pyspark_python, test_name, duration))
LOGGER.info("Finished test(%s): %s (%is)", pyspark_python, test_name, duration)


def get_default_python_executables():
Expand Down Expand Up @@ -118,7 +118,7 @@ def parse_opts():
def main():
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format="%(message)s")
opts = parse_opts()
LOGGER.info("Running PySpark tests. Output is in python/%s" % LOG_FILE)
LOGGER.info("Running PySpark tests. Output is in python/%s", LOG_FILE)
if os.path.exists(LOG_FILE):
os.remove(LOG_FILE)
python_execs = opts.python_executables.split(',')
Expand All @@ -129,8 +129,8 @@ def main():
else:
print("Error: unrecognized module %s" % module_name)
sys.exit(-1)
LOGGER.info("Will test against the following Python executables: %s" % python_execs)
LOGGER.info("Will test the following Python modules: %s" % [x.name for x in modules_to_test])
LOGGER.info("Will test against the following Python executables: %s", python_execs)
LOGGER.info("Will test the following Python modules: %s", [x.name for x in modules_to_test])

task_queue = Queue.Queue()
for python_exec in python_execs:
Expand Down Expand Up @@ -163,7 +163,7 @@ def process_queue(task_queue):
print_red("Exiting due to interrupt")
sys.exit(-1)
total_duration = time.time() - start_time
LOGGER.info("Tests passed in %i seconds" % total_duration)
LOGGER.info("Tests passed in %i seconds", total_duration)


if __name__ == "__main__":
Expand Down