Check if the given name matches the prefix or glob-pattern defined in ini configuration.
(self, option_name: str, name: str)
| 395 | return self.classnamefilter(name) or self.isnosetest(obj) |
| 396 | |
| 397 | def _matches_prefix_or_glob_option(self, option_name: str, name: str) -> bool: |
| 398 | """Check if the given name matches the prefix or glob-pattern defined |
| 399 | in ini configuration.""" |
| 400 | for option in self.config.getini(option_name): |
| 401 | if name.startswith(option): |
| 402 | return True |
| 403 | # Check that name looks like a glob-string before calling fnmatch |
| 404 | # because this is called for every name in each collected module, |
| 405 | # and fnmatch is somewhat expensive to call. |
| 406 | elif ("*" in option or "?" in option or "[" in option) and fnmatch.fnmatch( |
| 407 | name, option |
| 408 | ): |
| 409 | return True |
| 410 | return False |
| 411 | |
| 412 | def collect(self) -> Iterable[Union[nodes.Item, nodes.Collector]]: |
| 413 | if not getattr(self.obj, "__test__", True): |
no test coverage detected