Skip to content

Commit 4a79e1c

Browse files
committed
wip
1 parent 7049658 commit 4a79e1c

4 files changed

Lines changed: 14 additions & 0 deletions

File tree

mypy/metastore.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def commit(self) -> None:
6868
@abstractmethod
6969
def list_all(self) -> Iterable[str]: ...
7070

71+
@abstractmethod
72+
def close(self) -> None:
73+
"""Release any resources held by the backing store."""
74+
7175

7276
def random_string() -> str:
7377
return binascii.hexlify(os.urandom(8)).decode("ascii")
@@ -136,6 +140,9 @@ def list_all(self) -> Iterable[str]:
136140
for file in files:
137141
yield os.path.normpath(os_path_join(dir, file))
138142

143+
def close(self) -> None:
144+
pass
145+
139146

140147
SCHEMA = """
141148
CREATE TABLE IF NOT EXISTS files2 (

mypy/test/testcheck.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ def run_case_once(
232232

233233
if res:
234234
if options.cache_dir != os.devnull:
235+
if sys.platform == "win32":
236+
print(
237+
f"verify_cache {options.cache_dir=}, {os.devnull=}, {testcase.writescache=}"
238+
)
235239
self.verify_cache(module_data, res.manager, blocker, incremental_step)
236240

237241
name = "targets"

mypyc/test/test_run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
290290
for line in e.messages:
291291
print(fix_native_line_number(line, testcase.file, testcase.line))
292292
assert False, "Compile error"
293+
finally:
294+
result.manager.metastore.close()
293295

294296
# Check that serialization works on this IR. (Only on the first
295297
# step because the returned ir only includes updated code.)

mypyc/test/testutil.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def build_ir_for_single_file2(
139139
assert_func_ir_valid(fn)
140140
tree = result.graph[module.fullname].tree
141141
assert tree is not None
142+
result.manager.metastore.close()
142143
return module, tree, result.types, mapper
143144

144145

0 commit comments

Comments
 (0)