diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py index 77c820e51fa6..d6d051b1cb9c 100644 --- a/mypy/test/testcheck.py +++ b/mypy/test/testcheck.py @@ -1,6 +1,6 @@ """Type checker test cases""" -import os.path +import os import re import shutil import sys @@ -154,6 +154,8 @@ def run_case_once(self, testcase: DataDrivenTestCase, incremental: int = 0) -> N options.strict_optional = True if incremental: options.incremental = True + else: + options.cache_dir = os.devnull # Dont waste time writing cache sources = [] for module_name, program_path, program_text in module_data: diff --git a/mypy/test/testdeps.py b/mypy/test/testdeps.py index e1ee2b97e3e5..bfbf1db13391 100644 --- a/mypy/test/testdeps.py +++ b/mypy/test/testdeps.py @@ -1,6 +1,6 @@ """Test cases for generating node-level dependencies (for fine-grained incremental checking)""" -import os.path +import os from typing import List, Tuple, Dict from mypy import build @@ -54,6 +54,7 @@ def build(self, source: str) -> Tuple[List[str], options = Options() options.use_builtins_fixtures = True options.show_traceback = True + options.cache_dir = os.devnull try: result = build.build(sources=[BuildSource('main', None, source)], options=options, diff --git a/mypy/test/testdiff.py b/mypy/test/testdiff.py index f379a3735ce7..e24575b33d68 100644 --- a/mypy/test/testdiff.py +++ b/mypy/test/testdiff.py @@ -1,6 +1,6 @@ """Test cases for AST diff (used for fine-grained incremental checking)""" -import os.path +import os from typing import List, Tuple, Dict from mypy import build @@ -62,6 +62,7 @@ def build(self, source: str) -> Tuple[List[str], Dict[str, MypyFile]]: options = Options() options.use_builtins_fixtures = True options.show_traceback = True + options.cache_dir = os.devnull try: result = build.build(sources=[BuildSource('main', None, source)], options=options, diff --git a/mypy/test/testfinegrained.py b/mypy/test/testfinegrained.py index 21afc8572b44..fff2e18d26ba 100644 --- a/mypy/test/testfinegrained.py +++ b/mypy/test/testfinegrained.py @@ -7,7 +7,7 @@ information. """ -import os.path +import os import re import shutil from typing import List, Tuple, Dict @@ -83,6 +83,7 @@ def build(self, source: str) -> Tuple[List[str], BuildManager, Graph]: options = Options() options.use_builtins_fixtures = True options.show_traceback = True + options.cache_dir = os.devnull try: result = build.build(sources=[BuildSource('main', None, source)], options=options, diff --git a/mypy/test/testmerge.py b/mypy/test/testmerge.py index 6802e3431091..9807098877cf 100644 --- a/mypy/test/testmerge.py +++ b/mypy/test/testmerge.py @@ -1,6 +1,6 @@ """Test cases for AST merge (used for fine-grained incremental checking)""" -import os.path +import os import shutil from typing import List, Tuple, Dict @@ -100,6 +100,7 @@ def build(self, source: str) -> Tuple[List[str], BuildManager, Dict[str, State]] options = Options() options.use_builtins_fixtures = True options.show_traceback = True + options.cache_dir = os.devnull try: result = build.build(sources=[BuildSource('main', None, source)], options=options,