Skip to content
Snippets Groups Projects
Commit 92575205 authored by maljx's avatar maljx
Browse files

added make_coverage.py for use on win10, remove python2 compliant code

parent 07c09e51
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import os
import webbrowser
import subprocess
from urllib.request import pathname2url
def browser(pathname):
webbrowser.open("file:" + pathname2url(os.path.abspath(pathname)))
subprocess.call(['coverage', 'run', '--source', 'flatland', '-m', 'pytest'])
subprocess.call(['coverage', 'report', '-m'])
subprocess.call(['coverage', 'html'])
browser('htmlcov/index.html')
......@@ -3,13 +3,10 @@
import os
import webbrowser
import subprocess
from urllib.request import pathname2url
def browser(pathname):
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file:" + pathname2url(pathname))
webbrowser.open("file:" + pathname2url(os.path.abspath(pathname)))
def remove_exists(filename):
try:
......@@ -29,4 +26,4 @@ os.chdir('docs')
subprocess.call(['python', '-msphinx', '-M', 'clean', '.', '_build'])
subprocess.call(['python', '-msphinx', '-M', 'html', '.', '_build'])
browser(os.path.abspath('_build/html/index.html'))
browser('_build/html/index.html')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment