You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/06/15 22:55:59 UTC
svn commit: r955048 -
/subversion/trunk/subversion/tests/cmdline/svntest/main.py
Author: hwright
Date: Tue Jun 15 20:55:59 2010
New Revision: 955048
URL: http://svn.apache.org/viewvc?rev=955048&view=rev
Log:
Allow the parsing of test arguments from sources other than the commandline,
and let users get a copy of the default options set.
* subversion/tests/cmdline/svntest/main.py
(create_default_options): New.
(_parse_options): Take an optional list as the arguments source.
Modified:
subversion/trunk/subversion/tests/cmdline/svntest/main.py
Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=955048&r1=955047&r2=955048&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Tue Jun 15 20:55:59 2010
@@ -1278,7 +1278,13 @@ def _internal_run_tests(test_list, testn
return exit_code
-def _parse_options():
+def create_default_options():
+ """Set the global options to the defaults, as provided by the argument
+ parser."""
+ _parse_options([])
+
+
+def _parse_options(arglist=sys.argv[1:]):
"""Parse the arguments in arg_list, and set the global options object with
the results"""
@@ -1340,7 +1346,7 @@ def _parse_options():
url=file_scheme_prefix + pathname2url(os.path.abspath(os.getcwd())),
http_library='serf')
- (options, args) = parser.parse_args()
+ (options, args) = parser.parse_args(arglist)
# some sanity checking
if options.verbose and options.quiet: