comparison tests/test_util.py @ 715:c33293a34752

requiresoption: clean up docstring
author Augie Fackler <durin42@gmail.com>
date Sat, 02 Oct 2010 16:44:17 -0500
parents cfc7df19e4dc
children 38ebf7714cdf
comparison
equal deleted inserted replaced
714:7e55483a56ca 715:c33293a34752
87 87
88 FIXTURES = os.path.join(os.path.abspath(os.path.dirname(__file__)), 88 FIXTURES = os.path.join(os.path.abspath(os.path.dirname(__file__)),
89 'fixtures') 89 'fixtures')
90 90
91 def requiresoption(option): 91 def requiresoption(option):
92 ''' 92 '''Skip a test if commands.clone does not take the specified option.'''
93 Decorator for test functions which require clone to accept the given option.
94 If the option isn't available, the test is skipped.
95
96 Takes one argument: the required option.
97 '''
98 def decorator(fn): 93 def decorator(fn):
99 for entry in cmdutil.findcmd('clone', commands.table)[1][1]: 94 for entry in cmdutil.findcmd('clone', commands.table)[1][1]:
100 if entry[1] == option: 95 if entry[1] == option:
101 return fn 96 return fn
102 if not isinstance(option, str): 97 if not isinstance(option, str):