Skip to content

Instantly share code, notes, and snippets.

@andreif
Created April 12, 2018 09:00
Show Gist options
  • Select an option

  • Save andreif/182bdf925cef2a0d3ba2558bc349234f to your computer and use it in GitHub Desktop.

Select an option

Save andreif/182bdf925cef2a0d3ba2558bc349234f to your computer and use it in GitHub Desktop.
import os
repo_path = os.path.dirname(os.path.abspath(__file__))
xml_path = repo_path + '/coverage.xml'
with open(xml_path) as fp:
xml = fp.read()
if 'filename="/' not in xml:
xml = xml.replace('filename="', 'filename="' + repo_path + '/')
with open(xml_path, 'w+') as fp:
fp.write(xml)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment