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

Unified Diff: components/test/data/password_manager/automated_tests/run_tests.py

Issue 1143223002: [Password manager tests automation] Improves redability of code and logs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test/data/password_manager/automated_tests/run_tests.py
diff --git a/components/test/data/password_manager/automated_tests/run_tests.py b/components/test/data/password_manager/automated_tests/run_tests.py
index f64a26179317915403655cb32a9c19120adb8cb7..95cb4631bb004eab4e7d088a1de9ecc863588dcb 100644
--- a/components/test/data/password_manager/automated_tests/run_tests.py
+++ b/components/test/data/password_manager/automated_tests/run_tests.py
@@ -91,10 +91,9 @@ def LogResultsOfTestRun(config, results):
for result in results:
website, test_case, success, reason = result
if not (config.save_only_fails and success):
- logger.debug("Test case %s has %s on Website %s", test_case,
- website, {True: "passed", False: "failed"}[success])
if not success:
- logger.debug("Reason of failure: %s", reason)
+ logger.debug("%s.%s failed with reason: %s",
+ website, test_case, reason)
if not success:
failed_tests.append("%s.%s" % (website, test_case))
@@ -120,7 +119,7 @@ def RunTestCaseOnWebsite((website, test_case, config)):
logger.log(SCRIPT_DEBUG, "Run of test case %s of website %s started",
test_case, website)
try:
- with stopit.ThreadingTimeout(100) as timeout:
+ with stopit.ThreadingTimeout(seconds=100) as timeout:
logger.log(SCRIPT_DEBUG,
"Run test with parameters: %s %s %s %s %s %s",
config.chrome_path, config.chromedriver_path,
@@ -132,7 +131,7 @@ def RunTestCaseOnWebsite((website, test_case, config)):
if timeout.state != timeout.EXECUTED:
result = (website, test_case, False,
"Got %d as timeout state (see stopit.ThreadingTimeout for"
- "the meaning of the number)" % timeout.state)
+ " the meaning of the number)" % timeout.state)
_, _, success, _ = result
if success:
return result
« 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