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

Unified Diff: tools/telemetry/telemetry/page/page_runner_unittest.py

Issue 446153002: Clean up unittest_data/data/archive_blank_000.wpr after unittest finishes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/page_runner_unittest.py
diff --git a/tools/telemetry/telemetry/page/page_runner_unittest.py b/tools/telemetry/telemetry/page/page_runner_unittest.py
index 559f2b9067edb2e6d819f00f3ca93b2d32df3341..33431db57f3869a7a977f7803ca91b5cfd2ba384 100644
--- a/tools/telemetry/telemetry/page/page_runner_unittest.py
+++ b/tools/telemetry/telemetry/page/page_runner_unittest.py
@@ -554,12 +554,18 @@ class PageRunnerTests(unittest.TestCase):
test = ArchiveTest()
results = results_options.CreateResults(EmptyMetadataForTest(), options)
- page_runner.Run(test, ps, expectations, options, results)
- if expect_from_archive and not test.archive_path_exist:
- logging.warning('archive path did not exist, asserting that page '
- 'is from archive is skipped.')
- return
- self.assertEquals(expect_from_archive, test.is_page_from_archive)
+ try:
+ page_runner.Run(test, ps, expectations, options, results)
+ if expect_from_archive and not test.archive_path_exist:
+ logging.warning('archive path did not exist, asserting that page '
+ 'is from archive is skipped.')
+ return
+ self.assertEquals(expect_from_archive, test.is_page_from_archive)
+ finally:
+ for p in ps:
+ if os.path.isfile(p.archive_path):
+ os.remove(p.archive_path)
+
def testUseLiveSitesFlagSet(self):
options = options_for_unittests.GetCopy()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698