environment/lib/python2.7/site-packages/nose/plugins/cover.py
def configure(self, options, conf):
        """
        Configure plugin.
        """
        try:
            self.status.pop('active')
        except KeyError:
            pass
        super(Coverage, self).configure(options, conf)
        if conf.worker:
            return
        if self.enabled:
            try:
                import coverage
            except ImportError:
                log.error("Coverage not available: "
                          "unable to import coverage module")
                self.enabled = False
                return
        self.conf = conf
        self.coverErase = options.cover_erase
        self.coverTests = options.cover_tests
        self.coverPackages = []
        if options.cover_packages:
            for pkgs in [tolist(x) for x in options.cover_packages]:
                self.coverPackages.extend(pkgs)
        self.coverInclusive = options.cover_inclusive
        if self.coverPackages:
            log.info("Coverage report will include only packages: %s",
                     self.coverPackages)
        self.coverHtmlDir = None
        if options.cover_html:
            self.coverHtmlDir = options.cover_html_dir
            log.debug('Will put HTML coverage report in %s', self.coverHtmlDir)
        self.coverBranches = options.cover_branches
        self.coverXmlFile = None
        if options.cover_min_percentage:
            self.coverMinPercentage = int(options.cover_min_percentage.rstrip('%'))
        if options.cover_xml:
            self.coverXmlFile = options.cover_xml_file
            log.debug('Will put XML coverage report in %s', self.coverXmlFile)
        if self.enabled:
            self.status['active'] = True
            self.coverInstance = coverage.coverage(auto_data=False,
                branch=self.coverBranches, data_suffix=None)
def configure(self, options, conf):
        """
        Configure plugin.
        """
        try:
            self.status.pop('active')
        except KeyError:
            pass
        super(Coverage, self).configure(options, conf)
        if conf.worker:
            return
        if self.enabled:
            try:
                import coverage
            except ImportError:
                log.error("Coverage not available: "
                          "unable to import coverage module")
                self.enabled = False
                return
        self.conf = conf
        self.coverErase = options.cover_erase
        self.coverTests = options.cover_tests
        self.coverPackages = []
        if options.cover_packages:
            for pkgs in [tolist(x) for x in options.cover_packages]:
                self.coverPackages.extend(pkgs)
        self.coverInclusive = options.cover_inclusive
        if self.coverPackages:
            log.info("Coverage report will include only packages: %s",
                     self.coverPackages)
        self.coverHtmlDir = None
        if options.cover_html:
            self.coverHtmlDir = options.cover_html_dir
            log.debug('Will put HTML coverage report in %s', self.coverHtmlDir)
        self.coverBranches = options.cover_branches
        self.coverXmlFile = None
        if options.cover_min_percentage:
            self.coverMinPercentage = int(options.cover_min_percentage.rstrip('%'))
        if options.cover_xml:
            self.coverXmlFile = options.cover_xml_file
            log.debug('Will put XML coverage report in %s', self.coverXmlFile)
        if self.enabled:
            self.status['active'] = True
            self.coverInstance = coverage.coverage(auto_data=False,
                branch=self.coverBranches, data_suffix=None)
def configure ( self , options , conf ) : try : self . status . pop ( 'active' ) except KeyError : pass super ( Coverage , self ) . configure ( options , conf ) if conf . worker : return if self . enabled : try : import coverage except ImportError : log . error ( "Coverage not available: " "unable to import coverage module" ) self . enabled = False return self . conf = conf self . coverErase = options . cover_erase self . coverTests = options . cover_tests self . coverPackages = [ ] if options . cover_packages : for pkgs in [ tolist ( x ) for x in options . cover_packages ] : self . coverPackages . extend ( pkgs ) self . coverInclusive = options . cover_inclusive if self . coverPackages : log . info ( "Coverage report will include only packages: %s" , self . coverPackages ) self . coverHtmlDir = None if options . cover_html : self . coverHtmlDir = options . cover_html_dir log . debug ( 'Will put HTML coverage report in %s' , self . coverHtmlDir ) self . coverBranches = options . cover_branches self . coverXmlFile = None if options . cover_min_percentage : self . coverMinPercentage = int ( options . cover_min_percentage . rstrip ( '%' ) ) if options . cover_xml : self . coverXmlFile = options . cover_xml_file log . debug ( 'Will put XML coverage report in %s' , self . coverXmlFile ) if self . enabled : self . status [ 'active' ] = True self . coverInstance = coverage . coverage ( auto_data = False , branch = self . coverBranches , data_suffix = None )
Configure plugin.
Configure plugin .