[webkit-reviews] review denied: [Bug 37432] add basic mock unit tests to new-run-webkit-tests : [Attachment 53142] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Apr 11 20:50:41 PDT 2010
Adam Barth <abarth at webkit.org> has denied Dirk Pranke <dpranke at chromium.org>'s
request for review:
Bug 37432: add basic mock unit tests to new-run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=37432
Attachment 53142: Patch
https://bugs.webkit.org/attachment.cgi?id=53142&action=review
------- Additional Comments from Adam Barth <abarth at webkit.org>
+def real_main(options, args, print_results=True):
This is confusing. Python tries to trick you into having several levels of
main.
+try:
+ d = os.path.dirname(__file__)
+except NameError:
+ d = os.path.dirname(sys.argv[0])
+
+sys.path.append(os.path.abspath(os.path.join(d, '../thirdparty')))
What is this? We shouldn't be screwing around with sys.path.
+from run_webkit_tests import *
This should be:
from webkitpy.layout_test.run_webkit_tests import real_main, parse_args
Importing * make code very difficult to maintain because it imports all the
imports transitively.
+if __name__ == '__main__':
+ unittest.main()
We usually skip this part. You can run tests individually from test-webkitpy
anyway.
More information about the webkit-reviews
mailing list