Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: tools/tests/base_unittest.py

Issue 283123002: render_pictures: add --mismatchPath flag (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix SkDebuggerGUI Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/render_pictures_main.cpp ('k') | tools/tests/render_pictures_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tests/base_unittest.py
diff --git a/tools/tests/base_unittest.py b/tools/tests/base_unittest.py
index 2adaed0b70d050b1769c6e207bf9809952470d5a..f7ee570a246cc5a0f6e74ffba8868746927585e3 100755
--- a/tools/tests/base_unittest.py
+++ b/tools/tests/base_unittest.py
@@ -10,7 +10,9 @@ A wrapper around the standard Python unittest library, adding features we need
for various unittests within this directory.
"""
+import errno
import os
+import shutil
import sys
import unittest
@@ -26,6 +28,20 @@ class TestCase(unittest.TestCase):
"""Tell unittest framework to not print docstrings for test cases."""
return None
+ def create_empty_dir(self, path):
+ """Creates an empty directory at path and returns path.
+
+ Args:
+ path: path on local disk
+ """
+ shutil.rmtree(path=path, ignore_errors=True)
+ try:
+ os.makedirs(path)
+ except OSError as exc:
+ if exc.errno != errno.EEXIST:
+ raise
+ return path
+
def run_command(self, args):
"""Runs a program from the command line and returns stdout.
« no previous file with comments | « tools/render_pictures_main.cpp ('k') | tools/tests/render_pictures_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698