nosexcover-1.0.10/0000755000076500000240000000000012314410643014215 5ustar chrisstaff00000000000000nosexcover-1.0.10/nosexcover/0000755000076500000240000000000012314410643016410 5ustar chrisstaff00000000000000nosexcover-1.0.10/nosexcover/__init__.py0000644000076500000240000000004212314410222020506 0ustar chrisstaff00000000000000from .nosexcover import XCoverage nosexcover-1.0.10/nosexcover/nosexcover.py0000644000076500000240000000606512314410222021155 0ustar chrisstaff00000000000000"""Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your arguments. A Cobertura-style XML file, honoring the options you pass to --with-coverage, will be generated in coverage.xml""" import logging import sys try: # Python 2 import StringIO except ImportError: # Python 3 from io import StringIO from nose.plugins import cover, Plugin log = logging.getLogger('nose.plugins.xcover') class XCoverage(cover.Coverage): """ Add Cobertura-style XML coverage reports to the built-in nose.plugins.cover plugin. """ def options(self, parser, env): """ Add options to command line. """ Plugin.options(self, parser, env) parser.add_option('--xcoverage-file', action='store', default=env.get('NOSE_XCOVER_FILE', 'coverage.xml'), dest='xcoverage_file', metavar="FILE", help='Path to xml coverage report.' 'Default is coverage.xml in the working directory. ' '[NOSE_XCOVERAGE_FILE]') parser.add_option('--xcoverage-to-stdout', action='store', default=env.get('NOSE_XCOVER_TO_STDOUT', True), dest='xcoverage_to_stdout', help='Print coverage information to stdout.' 'Default is True (output coverage information to stdout). ' '[NOSE_XCOVER_TO_STDOUT]') def configure(self, options, config): coverage_on = options.enable_plugin_coverage xcoverage_on = options.enable_plugin_xcoverage if xcoverage_on and coverage_on: log.error( """You can not use both --with-xcover and --with-coverage. Using --with-xcover implies --with-coverage""") raise TypeError cover.old_log = cover.log cover.log = log super(XCoverage, self).configure(options, config) cover.log = cover.old_log self.xcoverageFile = options.xcoverage_file to_stdout = str(options.xcoverage_to_stdout) self.xcoverageToStdout = False if '0' in to_stdout or 'false' in to_stdout.lower() else True def report(self, stream): """ Output code coverage report. """ if not self.xcoverageToStdout: # This will create a false stream where output will be ignored stream = StringIO.StringIO() super(XCoverage, self).report(stream) if not hasattr(self, 'coverInstance'): # nose coverage plugin 1.0 and earlier import coverage self.coverInstance = coverage._the_coverage modules = [module for name, module in sys.modules.items() if self.wantModuleCoverage(name, module)] log.debug("Coverage report will cover modules: %s", modules) morfs = [m.__file__ for m in modules if hasattr(m, '__file__')] self.coverInstance.xml_report(morfs, outfile=self.xcoverageFile) nosexcover-1.0.10/nosexcover/tests.py0000644000076500000240000000007012314410222020112 0ustar chrisstaff00000000000000def test_sanity(): from nosexcover import XCoverage nosexcover-1.0.10/nosexcover.egg-info/0000755000076500000240000000000012314410643020102 5ustar chrisstaff00000000000000nosexcover-1.0.10/nosexcover.egg-info/dependency_links.txt0000644000076500000240000000000112314410643024150 0ustar chrisstaff00000000000000 nosexcover-1.0.10/nosexcover.egg-info/entry_points.txt0000644000076500000240000000007112314410643023376 0ustar chrisstaff00000000000000[nose.plugins] xcover = nosexcover.nosexcover:XCoverage nosexcover-1.0.10/nosexcover.egg-info/not-zip-safe0000644000076500000240000000000112117126251022330 0ustar chrisstaff00000000000000 nosexcover-1.0.10/nosexcover.egg-info/PKG-INFO0000644000076500000240000000353112314410643021201 0ustar chrisstaff00000000000000Metadata-Version: 1.1 Name: nosexcover Version: 1.0.10 Summary: Extends nose.plugins.cover to add Cobertura-style XML reports Home-page: http://github.com/cmheisel/nose-xcover/ Author: Chris Heisel Author-email: chris@heisel.org License: BSD Description: nose-xmlcover -------------- A companion to the built-in nose.plugins.cover, this plugin will write out an XML coverage report to a file named coverage.xml. It will honor all the options you pass to the `Nose coverage plugin `_, especially --cover-package. Usage ------ You can not use both --with-xcover and --with-coverage. Using --with-xcover implies --with-coverage If you want to change the name of the output file you can use --xcoverage-file=FILE (--cover-xml-file from coverage won't work) As of nose-xcover 1.0.6 --with-xcoverage provides all the functionality of the built-in coverage plugin in addition to Cobertura-style output:: #nosetests --with-xcoverage {{ coverage options }} nosetests --with-xcoverage --cover-package=myapp --cover-tests Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: Topic :: Software Development :: Libraries :: Python Modules nosexcover-1.0.10/nosexcover.egg-info/requires.txt0000644000076500000240000000002212314410643022474 0ustar chrisstaff00000000000000nose coverage>=3.4nosexcover-1.0.10/nosexcover.egg-info/SOURCES.txt0000644000076500000240000000047312314410643021772 0ustar chrisstaff00000000000000setup.py nosexcover/__init__.py nosexcover/nosexcover.py nosexcover/tests.py nosexcover.egg-info/PKG-INFO nosexcover.egg-info/SOURCES.txt nosexcover.egg-info/dependency_links.txt nosexcover.egg-info/entry_points.txt nosexcover.egg-info/not-zip-safe nosexcover.egg-info/requires.txt nosexcover.egg-info/top_level.txtnosexcover-1.0.10/nosexcover.egg-info/top_level.txt0000644000076500000240000000001312314410643022626 0ustar chrisstaff00000000000000nosexcover nosexcover-1.0.10/PKG-INFO0000644000076500000240000000353112314410643015314 0ustar chrisstaff00000000000000Metadata-Version: 1.1 Name: nosexcover Version: 1.0.10 Summary: Extends nose.plugins.cover to add Cobertura-style XML reports Home-page: http://github.com/cmheisel/nose-xcover/ Author: Chris Heisel Author-email: chris@heisel.org License: BSD Description: nose-xmlcover -------------- A companion to the built-in nose.plugins.cover, this plugin will write out an XML coverage report to a file named coverage.xml. It will honor all the options you pass to the `Nose coverage plugin `_, especially --cover-package. Usage ------ You can not use both --with-xcover and --with-coverage. Using --with-xcover implies --with-coverage If you want to change the name of the output file you can use --xcoverage-file=FILE (--cover-xml-file from coverage won't work) As of nose-xcover 1.0.6 --with-xcoverage provides all the functionality of the built-in coverage plugin in addition to Cobertura-style output:: #nosetests --with-xcoverage {{ coverage options }} nosetests --with-xcoverage --cover-package=myapp --cover-tests Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: Topic :: Software Development :: Libraries :: Python Modules nosexcover-1.0.10/setup.cfg0000644000076500000240000000007312314410643016036 0ustar chrisstaff00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 nosexcover-1.0.10/setup.py0000644000076500000240000000234612314410267015736 0ustar chrisstaff00000000000000from setuptools import setup, find_packages try: desc = open('README.rst').read() except: desc = 'see README.rst' setup( name='nosexcover', version='1.0.10', description='Extends nose.plugins.cover to add Cobertura-style XML reports', long_description=desc, author='Chris Heisel', author_email='chris@heisel.org', url='http://github.com/cmheisel/nose-xcover/', license='BSD', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=['nose', 'coverage>=3.4'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Topic :: Software Development :: Libraries :: Python Modules', ], entry_points={ 'nose.plugins': ['xcover = nosexcover.nosexcover:XCoverage'] }, )