Skip to content

Commit

Permalink
Verbose sending for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
coagulant committed Feb 9, 2013
1 parent 83920cf commit d487a4e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -9,5 +9,6 @@ script:
- coverage run --source=coveralls setup.py test
- coverage report -m
- python setup.py develop
- bin/coveralls
after_script:
- bin/coveralls --verbose

7 changes: 4 additions & 3 deletions bin/coveralls
Expand Up @@ -28,12 +28,13 @@ if __name__ == '__main__':
log.setLevel(level)

coverallz = Coveralls()
if options['debug']:
if options['--verbose']:
log.debug('Submitting this (sources excluded for brevity):')
data = coverallz.create_data()
data = coverallz.create_data().copy()
data.pop('source_files')
log.debug(pprint.pformat(data))
else:
if not options['debug']:
log.info("Submitting coverage to coveralls.io...")
result = coverallz.wear()
log.info("Coverage submitted!")
log.info(result['message'])
Expand Down
10 changes: 6 additions & 4 deletions coveralls/api.py
Expand Up @@ -34,6 +34,7 @@ def __init__(self, **kwargs):
* [service_job_id]
A unique identifier of the job on the service specified by service_name.
"""
self._data = None
self.config = kwargs
file_config = self.load_config()
repo_token = self.config.get('repo_token') or file_config.get('repo_token')
Expand Down Expand Up @@ -88,10 +89,11 @@ def create_data(self):
]
}
"""
data = {'source_files': self.get_coverage()}
data.update(self.git_info())
data.update(self.config)
return data
if not self._data:
self._data = {'source_files': self.get_coverage()}
self._data.update(self.git_info())
self._data.update(self.config)
return self._data

def write_file(self, data):
fd, name = tempfile.mkstemp()
Expand Down

0 comments on commit d487a4e

Please sign in to comment.