From 62a7492724ea4703989d9706278315492237895c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 26 Apr 2017 08:49:36 -0700 Subject: [PATCH 1/2] Disable cache in non-incremental tests Fixes #3253 --- mypy/test/testcheck.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py index 77c820e51fa6..8f68e30adde9 100644 --- a/mypy/test/testcheck.py +++ b/mypy/test/testcheck.py @@ -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: From b82863abce8f80625acbde0f78ad1b097fd13532 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 26 Apr 2017 09:53:35 -0700 Subject: [PATCH 2/2] Also disable cache writing for fine-grained tests. --- mypy/test/testcheck.py | 2 +- mypy/test/testdeps.py | 3 ++- mypy/test/testdiff.py | 3 ++- mypy/test/testfinegrained.py | 3 ++- mypy/test/testmerge.py | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py index 8f68e30adde9..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 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,