Skip to content

Commit fd4e1d4

Browse files
committed
fix
1 parent 3365f8a commit fd4e1d4

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

mypy/test/testcheck.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ def run_case_once(
199199
a = e.messages
200200
blocker = True
201201
finally:
202-
if res is not None:
203-
res.manager.metastore.close()
204202
assert sys.path[0] == plugin_dir
205203
del sys.path[0]
206204

@@ -233,7 +231,7 @@ def run_case_once(
233231
assert_string_arrays_equal(output, a, msg.format(testcase.file, testcase.line))
234232

235233
if res:
236-
if testcase.writescache:
234+
if options.cache_dir != os.devnull:
237235
self.verify_cache(module_data, res.manager, blocker, incremental_step)
238236

239237
name = "targets"
@@ -260,6 +258,7 @@ def run_case_once(
260258
assert_module_equivalence(
261259
"stale" + suffix, expected_stale, res.manager.stale_modules
262260
)
261+
res.manager.metastore.close()
263262

264263
if testcase.output_files:
265264
check_test_output_files(testcase, incremental_step, strip_prefix="tmp/")

test-data/unit/check-basic.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class C:
300300
main:2: error: The return type of "__init__" must be None
301301

302302
-- WritesCache signals to testcheck to do the cache validation
303-
[case testWritesCache]
303+
[case testWritesCache-writescache]
304304
import a
305305
import d
306306
[file a.py]
@@ -310,7 +310,7 @@ import c
310310
[file c.py]
311311
[file d.py]
312312

313-
[case testWritesCacheErrors]
313+
[case testWritesCacheErrors-writescache]
314314
import a
315315
import d
316316
[file a.py]

0 commit comments

Comments
 (0)