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

Unified Diff: test/runtest_test.py

Issue 3382009: Making runtest_test more tolerant of different versions of optparse... (Closed) Base URL: http://swtoolkit.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 3 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: test/runtest_test.py
===================================================================
--- test/runtest_test.py (revision 69)
+++ test/runtest_test.py (working copy)
@@ -31,7 +31,9 @@
"""Test runtest (hey, recursion!) (MEDIUM TEST)."""
import TestFramework
+import optparse
import os
+import StringIO
import sys
@@ -99,8 +101,11 @@
test.write('dummy_test.py', dummy_test_contents)
test.write('other.py', other_py_contents)
- # On mac, help output is slightly different
- if sys.platform == 'darwin':
+ # Alter expected result based on optparse version (string case changed).
+ op = optparse.OptionParser()
+ fh = StringIO.StringIO()
+ op.print_help(fh)
+ if 'Usage:' in fh.getvalue():
global expect_stdout
expect_stdout = expect_stdout.replace('usage:', 'Usage:')
expect_stdout = expect_stdout.replace('options:', 'Options:')
« 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