master
baztian 2017-03-10 13:31:19 +01:00
parent 8fc9ae8869
commit 47aa0c68a3
2 changed files with 12 additions and 2 deletions

View File

@ -4,16 +4,25 @@
http://stackoverflow.com/a/33012308/1960601
"""
import json
import os
import pickle
import sys
from subprocess import call
def convert_old_coverage_to_new(filename):
with open(filename, "rb") as inp_file:
coverage_results = pickle.load(inp_file)
main_results ={"lines": coverage_results['lines']}
with open(".coverage","w") as out_file:
out_file.write("!coverage.py: This is a private format,"
"don't read it directly!")
out_file.write(json.dumps(main_results))
if __name__ == '__main__':
if sys.platform.lower().startswith('java'):
print("Export to coveralls skipped for Jython")
sys.exit(0)
convert_old_coverage_to_new(".coverage")
if 'TRAVIS' in os.environ:
rc = call('coveralls')
raise SystemExit(rc)

View File

@ -23,6 +23,7 @@ deps =
py26: unittest2==0.5.1
# urllib3 required by coveralls. See https://github.com/eddyxu/cpp-coveralls/issues/108
py26: urllib3[secure]
jython-driver: coverage==3.7.1
py: JPype1==0.6.2
jip==0.9.10
coveralls