GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Slow collection time when tests are not in a relative folder to the current working folder · Issue #13420 · pytest-dev/pytest Closed Labels topic: collectionrelated to the collection phasetype: performanceperformance or memory problem/improvement DescriptionCreated after this discussion - #13413 OSes, python and pytest versionsOS: macOS 15.4.1, Ubuntu 22.04 Problem descriptionI need to execute a lot of non-python tests that are stored in folders with lots of nesting. And I found that Pytest struggles during the collection. Some code context: @pytest.hookimpl(wrapper=True) def pytest_collection(session): resolved_paths = resolve_suites(session) session.config.args.extend(resolved_paths) return (yield) def pytest_collect_file(parent, file_path): if file_path.suffix == ".yaml": return YamlFile.from_parent(parent, path=file_path) class YamlFile(pytest.File): def collect(self) -> Iterable[pytest.Item | pytest.Collector]: test_cases = YamlTestResolver().from_file(f"{self.path}") # leftover from previous runner, but resolves needed stuff. for tc in test_cases: yield YamlTest.from_parent(self, name=tc.name, tc_spec=tc) class YamlTest(pytest.Item): def __init__(self, ptul_tc, **kwargs) -> None: super().__init__(**kwargs) self.tc_spec = tc_spec Consider this folder structure: But even more subfolders in Pytest call is the following: When I execute the above from The most significant time difference in the two calls is in the cumulative time of that function - According to stats, when executing from framework_internal_folder, the most struggling function is here: Possible solutionsCache for
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |