MCPcopy Create free account
hub / github.com/Distrotech/reportlab / findSuspiciousModules

Method findSuspiciousModules

tests/test_pyfiles.py:111–124  ·  view source on GitHub ↗

Get all modul paths with non-Unix-like first line.

(self, folder, rootName)

Source from the content-addressed store, hash-verified

109 "Testing if objects in the ReportLab package have docstrings."
110
111 def findSuspiciousModules(self, folder, rootName):
112 "Get all modul paths with non-Unix-like first line."
113
114 firstLinePat = re.compile('^#!.*python.*')
115
116 paths = []
117 for file in GlobDirectoryWalker(folder, '*.py'):
118 if os.path.basename(file) == '__init__.py':
119 continue
120 firstLine = open_and_readlines(file)[0]
121 if not firstLinePat.match(firstLine):
122 paths.append(file)
123
124 return paths
125
126 def test1(self):
127 "Test if all Python files have a Unix-like first line."

Callers 1

test1Method · 0.95

Calls 3

GlobDirectoryWalkerClass · 0.90
open_and_readlinesFunction · 0.90
appendMethod · 0.80

Tested by

no test coverage detected