Commits

Anonymous committed 4035276

Changes to cov option, reporting and imports.

Change cov option to work on filesystem paths and make the help
text more clear.

Change reporting to indicating files and dirs written to. Also
output warning if nothing to report on.

Minimise imports by only importing if actually needed.

Comments (0)

Files changed (2)

 """Coverage plugin for nose."""
 
-import cov_core
 import logging
 
 from nose.plugins.base import Plugin
 log = logging.getLogger(__name__)
 
 class Cov(Plugin):
-    """Activate cov plugin to generate coverage reports """
+    """Activate cov plugin to generate coverage reports"""
 
     score = 200
     status = {}
         log.debug('nose-cov options')
 
         Plugin.options(self, parser, env)
-        parser.add_option('--cov', action='append', default=env.get('NOSE_COV', []), metavar='DIR',
+        parser.add_option('--cov', action='append', default=env.get('NOSE_COV', []), metavar='PATH',
                           dest='cov_source',
-                          help=('Measure coverage for selected dirs '
+                          help=('Measure coverage for filesystem path '
                                 '[NOSE_COV]'))
         parser.add_option('--cov-report', action='append', default=env.get('NOSE_COV_REPORT', []), metavar='TYPE',
                           choices=['term', 'term-missing', 'annotate', 'html', 'xml'],
     def begin(self):
         """Erase any previous coverage data and start coverage."""
 
+        import cov_core
+
         log.debug('nose-cov begin')
         self.cov_controller = cov_core.Central(self.cov_source, self.cov_report, self.cov_config)
         self.cov_controller.start()
 import setuptools
 
 setuptools.setup(name='nose-cov',
-                 version='1.1',
-                 description='nose plugin for coverage reporting',
+                 version='1.2',
+                 description='nose plugin for coverage reporting, including subprocesses',
                  long_description=open('README.txt').read().strip(),
                  author='Meme Dough',
                  author_email='memedough@gmail.com',
                  url='http://bitbucket.org/memedough/nose-cov/overview',
                  py_modules=['nose_cov'],
                  install_requires=['nose>=0.11.4',
-                                   'cov-core>=1.0'],
+                                   'cov-core>=1.1'],
                  entry_points={'nose.plugins': ['cov = nose_cov:Cov']},
                  license='MIT License',
                  zip_safe=False,