MCPcopy Create free account
hub / github.com/libgit2/pygit2 / __enter__

Method __enter__

test/utils.py:123–134  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

121 self.tmp_path = tmp_path
122
123 def __enter__(self) -> Path:
124 path = Path(__file__).parent / 'data' / self.name
125 temp_repo_path = Path(self.tmp_path) / path.stem
126 if path.suffix == '.zip':
127 with zipfile.ZipFile(path) as zipf:
128 zipf.extractall(self.tmp_path)
129 elif path.suffix == '.git':
130 shutil.copytree(path, temp_repo_path)
131 else:
132 raise ValueError(f'Unexpected {path.suffix} extension')
133
134 return temp_repo_path
135
136 def __exit__(
137 self,

Callers 1

create_transactionFunction · 0.45

Calls

no outgoing calls

Tested by 1

create_transactionFunction · 0.36