marvin: enable the nose-marvin plugin using the --with-marvin directive

enable the marvin plugin when the --with-marvin directive is given to nose. The
enableOpt value is set from the command line directive and self.enabled
(True|False) determines whether marvin's tests will run.  By default
non-default plugins like marvin will be disabled"

This fixes regression from 03830c5

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2013-10-29 15:44:57 +05:30
parent 9300d4a3ba
commit ddf4dfa60a
2 changed files with 12 additions and 3 deletions

View File

@ -19,9 +19,6 @@ import cloudstackConnection
import asyncJobMgr
import dbConnection
from cloudstackAPI import *
import random
import string
import hashlib
'''
@Desc : CloudStackTestClient is encapsulated class for getting various \

View File

@ -33,6 +33,18 @@ class MarvinPlugin(Plugin):
name = "marvin"
def configure(self, options, config):
"""enable the marvin plugin when the --with-marvin directive
is given to nose. The enableOpt value is set from the command line directive
and self.enabled (True|False) determines whether marvin's tests will run.
By default non-default plugins like marvin will be disabled
"""
if hasattr(options, self.enableOpt):
if not getattr(options, self.enableOpt):
self.enabled = False
return
else:
self.enabled = True
self.logformat = logging.Formatter("%(asctime)s - %(levelname)s - " +
"%(name)s - %(message)s")