Skip to content

Commit cdbf741

Browse files
committed
Try avoiding race conditions
1 parent 66093ae commit cdbf741

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/regr_test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def run_testcases(
175175
else:
176176
configurations = mypy_configuration_from_distribution(package.name)
177177

178-
with temporary_mypy_config_file(configurations) as temp:
178+
with temporary_mypy_config_file(configurations) as temp_config, tempfile.TemporaryDirectory() as temp_cache_dir:
179179

180180
# "--enable-error-code ignore-without-code" is purposefully omitted.
181181
# See https://github.com/python/typeshed/pull/8083
@@ -189,10 +189,14 @@ def run_testcases(
189189
"--strict",
190190
"--pretty",
191191
"--config-file",
192-
temp.name,
192+
temp_config.name,
193193
# Avoid race conditions when reading the cache
194194
# (https://github.com/python/typeshed/issues/11220)
195195
"--no-incremental",
196+
# Avoid race conditions even harder
197+
# https://github.com/python/mypy/issues/13916
198+
"--cache-dir",
199+
temp_cache_dir,
196200
# Not useful for the test cases
197201
"--disable-error-code=empty-body",
198202
]

0 commit comments

Comments
 (0)