MCPcopy
hub / github.com/pytest-dev/pytest / __call__

Method __call__

src/_pytest/_py/path.py:177–196  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

175 self.pattern = pattern
176
177 def __call__(self, path):
178 pattern = self.pattern
179
180 if (
181 pattern.find(path.sep) == -1
182 and iswin32
183 and pattern.find(posixpath.sep) != -1
184 ):
185 # Running on Windows, the pattern has no Windows path separators,
186 # and the pattern has one or more Posix path separators. Replace
187 # the Posix path separators with the Windows path separator.
188 pattern = pattern.replace(posixpath.sep, path.sep)
189
190 if pattern.find(path.sep) == -1:
191 name = path.basename
192 else:
193 name = str(path) # path.strpath # XXX svn?
194 if not os.path.isabs(pattern):
195 pattern = "*" + path.sep + pattern
196 return fnmatch.fnmatch(name, pattern)
197
198
199def map_as_list(func, iter):

Callers

nothing calls this directly

Calls 1

fnmatchMethod · 0.45

Tested by

no test coverage detected