Skip to content

Commit 84ebd45

Browse files
gvanrossumJukkaL
authored andcommitted
Disable cache in non-incremental tests (#3255)
* Disable cache in non-incremental tests Fixes #3253 * Also disable cache writing for fine-grained tests.
1 parent 09b6d4b commit 84ebd45

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

mypy/test/testcheck.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Type checker test cases"""
22

3-
import os.path
3+
import os
44
import re
55
import shutil
66
import sys
@@ -154,6 +154,8 @@ def run_case_once(self, testcase: DataDrivenTestCase, incremental: int = 0) -> N
154154
options.strict_optional = True
155155
if incremental:
156156
options.incremental = True
157+
else:
158+
options.cache_dir = os.devnull # Dont waste time writing cache
157159

158160
sources = []
159161
for module_name, program_path, program_text in module_data:

mypy/test/testdeps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Test cases for generating node-level dependencies (for fine-grained incremental checking)"""
22

3-
import os.path
3+
import os
44
from typing import List, Tuple, Dict
55

66
from mypy import build
@@ -54,6 +54,7 @@ def build(self, source: str) -> Tuple[List[str],
5454
options = Options()
5555
options.use_builtins_fixtures = True
5656
options.show_traceback = True
57+
options.cache_dir = os.devnull
5758
try:
5859
result = build.build(sources=[BuildSource('main', None, source)],
5960
options=options,

mypy/test/testdiff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Test cases for AST diff (used for fine-grained incremental checking)"""
22

3-
import os.path
3+
import os
44
from typing import List, Tuple, Dict
55

66
from mypy import build
@@ -62,6 +62,7 @@ def build(self, source: str) -> Tuple[List[str], Dict[str, MypyFile]]:
6262
options = Options()
6363
options.use_builtins_fixtures = True
6464
options.show_traceback = True
65+
options.cache_dir = os.devnull
6566
try:
6667
result = build.build(sources=[BuildSource('main', None, source)],
6768
options=options,

mypy/test/testfinegrained.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
information.
88
"""
99

10-
import os.path
10+
import os
1111
import re
1212
import shutil
1313
from typing import List, Tuple, Dict
@@ -83,6 +83,7 @@ def build(self, source: str) -> Tuple[List[str], BuildManager, Graph]:
8383
options = Options()
8484
options.use_builtins_fixtures = True
8585
options.show_traceback = True
86+
options.cache_dir = os.devnull
8687
try:
8788
result = build.build(sources=[BuildSource('main', None, source)],
8889
options=options,

mypy/test/testmerge.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Test cases for AST merge (used for fine-grained incremental checking)"""
22

3-
import os.path
3+
import os
44
import shutil
55
from typing import List, Tuple, Dict
66

@@ -100,6 +100,7 @@ def build(self, source: str) -> Tuple[List[str], BuildManager, Dict[str, State]]
100100
options = Options()
101101
options.use_builtins_fixtures = True
102102
options.show_traceback = True
103+
options.cache_dir = os.devnull
103104
try:
104105
result = build.build(sources=[BuildSource('main', None, source)],
105106
options=options,

0 commit comments

Comments
 (0)