MCPcopy
hub / github.com/mitmproxy/mitmproxy / check_test_files_have_src

Function check_test_files_have_src

test/filename_matching.py:33–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32
33def check_test_files_have_src():
34 unknown_test_files = []
35
36 excluded = [
37 "test/mitmproxy/data/",
38 "test/mitmproxy/net/data/",
39 "/tservers.py",
40 "/conftest.py",
41 ]
42 test_files = glob.glob("test/mitmproxy/**/*.py", recursive=True)
43 test_files = [f for f in test_files if os.path.basename(f) != "__init__.py"]
44 test_files = [
45 f for f in test_files if not any(os.path.normpath(p) in f for p in excluded)
46 ]
47 for f in test_files:
48 p = os.path.join(
49 re.sub("^test/", "", os.path.dirname(f)),
50 re.sub("^test_", "", os.path.basename(f)),
51 )
52 if not os.path.isfile(p):
53 unknown_test_files.append((f, p))
54
55 return unknown_test_files
56
57
58def main():

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…