(
self, items: List[nodes.Item]
)
| 398 | |
| 399 | @hookimpl(hookwrapper=True, tryfirst=True) |
| 400 | def pytest_collection_modifyitems( |
| 401 | self, items: List[nodes.Item] |
| 402 | ) -> Generator[None, None, None]: |
| 403 | yield |
| 404 | |
| 405 | if self.active: |
| 406 | new_items: Dict[str, nodes.Item] = {} |
| 407 | other_items: Dict[str, nodes.Item] = {} |
| 408 | for item in items: |
| 409 | if item.nodeid not in self.cached_nodeids: |
| 410 | new_items[item.nodeid] = item |
| 411 | else: |
| 412 | other_items[item.nodeid] = item |
| 413 | |
| 414 | items[:] = self._get_increasing_order( |
| 415 | new_items.values() |
| 416 | ) + self._get_increasing_order(other_items.values()) |
| 417 | self.cached_nodeids.update(new_items) |
| 418 | else: |
| 419 | self.cached_nodeids.update(item.nodeid for item in items) |
| 420 | |
| 421 | def _get_increasing_order(self, items: Iterable[nodes.Item]) -> List[nodes.Item]: |
| 422 | return sorted(items, key=lambda item: item.path.stat().st_mtime, reverse=True) # type: ignore[no-any-return] |
nothing calls this directly
no test coverage detected