nose-json-0.2.4/000755 000765 000024 00000000000 11763220620 014207 5ustar00dcramerstaff000000 000000 nose-json-0.2.4/nose_json/000755 000765 000024 00000000000 11763220620 016204 5ustar00dcramerstaff000000 000000 nose-json-0.2.4/nose_json.egg-info/000755 000765 000024 00000000000 11763220620 017676 5ustar00dcramerstaff000000 000000 nose-json-0.2.4/PKG-INFO000644 000765 000024 00000000700 11763220620 015301 0ustar00dcramerstaff000000 000000 Metadata-Version: 1.0 Name: nose-json Version: 0.2.4 Summary: A JSON report plugin for Nose. Home-page: http://github.com/dcramer/nose-json Author: David Cramer Author-email: dcramer@gmail.com License: Apache License 2.0 Description: UNKNOWN Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: Intended Audience :: System Administrators Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development nose-json-0.2.4/setup.cfg000644 000765 000024 00000000073 11763220620 016030 0ustar00dcramerstaff000000 000000 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 nose-json-0.2.4/._setup.py000644 000765 000024 00000000273 11763220575 016151 0ustar00dcramerstaff000000 000000 Mac OS X  2‰»ATTR»˜#˜#com.macromates.caret{ column = 21; line = 18; }nose-json-0.2.4/setup.py000644 000765 000024 00000001673 11763220575 015741 0ustar00dcramerstaff000000 000000 #!/usr/bin/env python from setuptools import setup, find_packages tests_require = [ ] setup( name='nose-json', version='0.2.4', author='David Cramer', author_email='dcramer@gmail.com', description='A JSON report plugin for Nose.', url='http://github.com/dcramer/nose-json', packages=find_packages(exclude=["tests"]), zip_safe=False, install_requires=[ 'nose>=0.9', 'simplejson', ], entry_points={ 'nose.plugins.0.10': [ 'nose_json = nose_json.plugin:JsonReportPlugin' ] }, license='Apache License 2.0', tests_require=tests_require, extras_require={'test': tests_require}, test_suite='runtests.runtests', include_package_data=True, classifiers=[ 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Operating System :: OS Independent', 'Topic :: Software Development' ], ) nose-json-0.2.4/nose_json.egg-info/dependency_links.txt000644 000765 000024 00000000001 11763220620 023744 0ustar00dcramerstaff000000 000000 nose-json-0.2.4/nose_json.egg-info/entry_points.txt000644 000765 000024 00000000103 11763220620 023166 0ustar00dcramerstaff000000 000000 [nose.plugins.0.10] nose_json = nose_json.plugin:JsonReportPlugin nose-json-0.2.4/nose_json.egg-info/not-zip-safe000644 000765 000024 00000000001 11667747642 022151 0ustar00dcramerstaff000000 000000 nose-json-0.2.4/nose_json.egg-info/PKG-INFO000644 000765 000024 00000000700 11763220620 020770 0ustar00dcramerstaff000000 000000 Metadata-Version: 1.0 Name: nose-json Version: 0.2.4 Summary: A JSON report plugin for Nose. Home-page: http://github.com/dcramer/nose-json Author: David Cramer Author-email: dcramer@gmail.com License: Apache License 2.0 Description: UNKNOWN Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: Intended Audience :: System Administrators Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development nose-json-0.2.4/nose_json.egg-info/requires.txt000644 000765 000024 00000000035 11763220620 022274 0ustar00dcramerstaff000000 000000 nose>=0.9 simplejson [test] nose-json-0.2.4/nose_json.egg-info/SOURCES.txt000644 000765 000024 00000000432 11763220620 021561 0ustar00dcramerstaff000000 000000 setup.py nose_json/__init__.py nose_json/plugin.py nose_json.egg-info/PKG-INFO nose_json.egg-info/SOURCES.txt nose_json.egg-info/dependency_links.txt nose_json.egg-info/entry_points.txt nose_json.egg-info/not-zip-safe nose_json.egg-info/requires.txt nose_json.egg-info/top_level.txtnose-json-0.2.4/nose_json.egg-info/top_level.txt000644 000765 000024 00000000012 11763220620 022421 0ustar00dcramerstaff000000 000000 nose_json nose-json-0.2.4/nose_json/.___init__.py000644 000765 000024 00000000270 11713147173 020537 0ustar00dcramerstaff000000 000000 Mac OS X  2†žATTRž˜ ˜ com.macromates.caretxœ«æR‚äüœÒÜ<[k0?'3/«‹™nose-json-0.2.4/nose_json/__init__.py000644 000765 000024 00000000104 11713147173 020316 0ustar00dcramerstaff000000 000000 """ nose_json ~~~~~~~~~ :copyright: 2012 DISQUS. :license: BSD """ nose-json-0.2.4/nose_json/._plugin.py000644 000765 000024 00000000273 11763220406 020275 0ustar00dcramerstaff000000 000000 Mac OS X  2‰»ATTR»˜#˜#com.macromates.caret{ column = 27; line = 28; }nose-json-0.2.4/nose_json/plugin.py000644 000765 000024 00000007260 11763220406 020063 0ustar00dcramerstaff000000 000000 """ nose_json.plugin ~~~~~~~~~~~~~~~~ :copyright: 2012 DISQUS. :license: BSD """ import codecs import os import simplejson import traceback from time import time from nose.exc import SkipTest from nose.plugins import Plugin from nose.plugins.xunit import id_split, nice_classname, exc_message class JsonReportPlugin(Plugin): name = 'json' score = 2000 encoding = 'UTF-8' def _timeTaken(self): if hasattr(self, '_timer'): taken = time() - self._timer else: # test died before it ran (probably error in setup()) # or success/failure added before test started probably # due to custom TestResult munging taken = 0.0 return taken def options(self, parser, env): Plugin.options(self, parser, env) parser.add_option( '--json-file', action='store', dest='json_file', metavar="FILE", default=env.get('NOSE_JSON_FILE', 'nosetests.json'), help=("Path to json file to store the report in. " "Default is nosetests.json in the working directory " "[NOSE_JSON_FILE]")) def configure(self, options, config): Plugin.configure(self, options, config) self.config = config if not self.enabled: return self.stats = {'errors': 0, 'failures': 0, 'passes': 0, 'skipped': 0 } self.results = [] report_output = options.json_file path = os.path.dirname(report_output) if not os.path.exists(path): os.makedirs(path) self.report_output = report_output def report(self, stream): self.stats['encoding'] = self.encoding self.stats['total'] = (self.stats['errors'] + self.stats['failures'] + self.stats['passes'] + self.stats['skipped']) with codecs.open(self.report_output, 'w', self.encoding, 'replace') as fp: fp.write(simplejson.dumps({ 'stats': self.stats, 'results': self.results, })) def startTest(self, test): self._timer = time() def addError(self, test, err, capt=None): taken = self._timeTaken() if issubclass(err[0], SkipTest): type = 'skipped' self.stats['skipped'] += 1 else: type = 'error' self.stats['errors'] += 1 tb = ''.join(traceback.format_exception(*err)) id = test.id() self.results.append({ 'classname': ':'.join(id_split(id)[0].rsplit('.', 1)), 'name': id_split(id)[-1], 'time': taken, 'type': type, 'errtype': nice_classname(err[0]), 'message': exc_message(err), 'tb': tb, }) def addFailure(self, test, err, capt=None, tb_info=None): taken = self._timeTaken() tb = ''.join(traceback.format_exception(*err)) self.stats['failures'] += 1 id = test.id() self.results.append({ 'classname': ':'.join(id_split(id)[0].rsplit('.', 1)), 'name': id_split(id)[-1], 'time': taken, 'type': 'failure', 'errtype': nice_classname(err[0]), 'message': exc_message(err), 'tb': tb, }) def addSuccess(self, test, capt=None): taken = self._timeTaken() self.stats['passes'] += 1 id = test.id() self.results.append({ 'classname': ':'.join(id_split(id)[0].rsplit('.', 1)), 'name': id_split(id)[-1], 'time': taken, 'type': 'success', })