MCPcopy
hub / github.com/mitmproxy/mitmproxy / check_src_files_have_test

Function check_src_files_have_test

test/filename_matching.py:8–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def check_src_files_have_test():
9 missing_test_files = []
10
11 excluded = [
12 "mitmproxy/contrib/",
13 "mitmproxy/io/proto/",
14 "mitmproxy/proxy/layers/http",
15 "mitmproxy/test/",
16 "mitmproxy/tools/",
17 "mitmproxy/platform/",
18 "mitmproxy/utils/pyinstaller/",
19 ]
20 src_files = glob.glob("mitmproxy/**/*.py", recursive=True)
21 src_files = [f for f in src_files if os.path.basename(f) != "__init__.py"]
22 src_files = [
23 f for f in src_files if not any(os.path.normpath(p) in f for p in excluded)
24 ]
25 for f in src_files:
26 p = os.path.join("test", os.path.dirname(f), "test_" + os.path.basename(f))
27 if not os.path.isfile(p):
28 missing_test_files.append((f, p))
29
30 return missing_test_files
31
32
33def check_test_files_have_src():

Callers 1

mainFunction · 0.85

Calls 2

joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…