nosexcover-1.0.11/0000755000076600000240000000000013005365257014710 5ustar cmheiselstaff00000000000000nosexcover-1.0.11/nosexcover/0000755000076600000240000000000013005365257017103 5ustar cmheiselstaff00000000000000nosexcover-1.0.11/nosexcover/__init__.py0000644000076600000240000000004213005364542021204 0ustar cmheiselstaff00000000000000from .nosexcover import XCoverage nosexcover-1.0.11/nosexcover/nosexcover.py0000644000076600000240000000630313005364542021646 0ustar cmheiselstaff00000000000000"""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 from StringIO 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: error_msg = """You can not use both --with-xcover and --with-coverage. Using --with-xcover implies --with-coverage""" log.error(error_msg) raise TypeError(error_msg + "\n Please check if you have a default entry in .noserc or nose.cfg or setup.cfg alike configuration file") 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() 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.11/nosexcover/tests.py0000644000076600000240000000007013005364542020610 0ustar cmheiselstaff00000000000000def test_sanity(): from nosexcover import XCoverage nosexcover-1.0.11/nosexcover.egg-info/0000755000076600000240000000000013005365257020575 5ustar cmheiselstaff00000000000000nosexcover-1.0.11/nosexcover.egg-info/dependency_links.txt0000644000076600000240000000000113005365257024643 0ustar cmheiselstaff00000000000000 nosexcover-1.0.11/nosexcover.egg-info/entry_points.txt0000644000076600000240000000007113005365257024071 0ustar cmheiselstaff00000000000000[nose.plugins] xcover = nosexcover.nosexcover:XCoverage nosexcover-1.0.11/nosexcover.egg-info/not-zip-safe0000644000076600000240000000000113005364714023020 0ustar cmheiselstaff00000000000000 nosexcover-1.0.11/nosexcover.egg-info/PKG-INFO0000644000076600000240000000353413005365257021677 0ustar cmheiselstaff00000000000000Metadata-Version: 1.1 Name: nosexcover Version: 1.0.11 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-xcoverage 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.11/nosexcover.egg-info/requires.txt0000644000076600000240000000002313005365257023170 0ustar cmheiselstaff00000000000000nose coverage>=3.4 nosexcover-1.0.11/nosexcover.egg-info/SOURCES.txt0000644000076600000240000000052013005365257022456 0ustar cmheiselstaff00000000000000README.rst setup.cfg setup.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.11/nosexcover.egg-info/top_level.txt0000644000076600000240000000001313005365257023321 0ustar cmheiselstaff00000000000000nosexcover nosexcover-1.0.11/PKG-INFO0000644000076600000240000000353413005365257016012 0ustar cmheiselstaff00000000000000Metadata-Version: 1.1 Name: nosexcover Version: 1.0.11 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-xcoverage 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.11/README.rst0000644000076600000240000000152513005364542016376 0ustar cmheiselstaff00000000000000nose-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-xcoverage 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 nosexcover-1.0.11/setup.cfg0000644000076600000240000000013013005365257016523 0ustar cmheiselstaff00000000000000[bdist_wheel] universal = 1 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 nosexcover-1.0.11/setup.py0000644000076600000240000000234613005364640016422 0ustar cmheiselstaff00000000000000from setuptools import setup, find_packages try: desc = open('README.rst').read() except: desc = 'see README.rst' setup( name='nosexcover', version='1.0.11', 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'] }, )