forked from corrscope/corrscope
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.py
More file actions
60 lines (43 loc) · 1.03 KB
/
Copy pathscripts.py
File metadata and controls
60 lines (43 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
""" poetry run func_name """
import shlex
import webbrowser
# Obtain path from package.dist-info/entry_points.txt
def run(path, arg_str):
module, func = path.split(":")
argv = shlex.split(arg_str)
exec(
f"""\
from {module} import {func}
{func}({argv})
"""
)
# public:
def dcover():
""" Run coverage and diff-cover."""
cover()
diff()
def rcover():
""" Run coverage and report. """
cover()
report()
def hcover():
""" Run coverage and open HTML. """
cover()
html()
# public helpers:
def cover():
run("pytest:main", "--tb=short --cov=corrscope")
def diff():
# argv[0:]
run("diff_cover.tool:main", "diff-cover coverage.xml")
def report():
run("coverage.cmdline:main", "report")
def html():
run("coverage.cmdline:main", "html")
webbrowser.open("htmlcov/index.html")
"""
export MONKEYTYPE_TRACE_MODULES=corrscope
monkeytype run `which pytest`
// monkeytype run -m corrscope
monkeytype list-modules | xargs -I % -n 1 sh -c 'monkeytype apply % 2>&1 | tail -n4'
"""