commit 76be9a1488e60ace3c035cd20d62c82a4c7ca9f5 from: Stefan Sperling date: Fri Oct 18 09:36:58 2024 UTC initialize 'counts' earlier to avoid spurious errors from tests If self.counts is not initialized then failing tests may produce an additional error about self.counts not existing, rather than failing on actual test assertions. commit - 6696db87df596de8919995f7239e85752ae6fba1 commit + 76be9a1488e60ace3c035cd20d62c82a4c7ca9f5 blob - 29f2a42d7bc24059eff3bc060e52b87a482491f2 blob + ab06908c114ee6bf420257182ea14c6db8492c9e --- swh/loader/git/loader.py +++ swh/loader/git/loader.py @@ -285,6 +285,7 @@ class GitLoader(BaseGitLoader): self.urllib3_extra_kwargs["cert_reqs"] = "CERT_NONE" self.requests_extra_kwargs["verify"] = False self.objects_seen: Set[bytes] = set() + self.counts: Dict[str, int] = collections.defaultdict(int) def fetch_pack_from_origin( self, @@ -1044,7 +1045,6 @@ class GitLoader(BaseGitLoader): if self.save_data_path: self.save_data() - self.counts: Dict[str, int] = collections.defaultdict(int) storage_summary: Dict[str, int] = collections.Counter() base_repo = self.repo_representation(