From 7b3d52a909ee78a0609635e97a92ebd8f6f2ebc9 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Sat, 21 Nov 2020 23:42:45 -0800 Subject: [PATCH] actually inherit from FileSystemCache to appease mypyc This means we could accidentally fallback to calling a FileSystemCache method if stuff gets moved around. --- mypy/test/test_find_sources.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mypy/test/test_find_sources.py b/mypy/test/test_find_sources.py index 2b6b0178c32ed..8d16fcf925e51 100644 --- a/mypy/test/test_find_sources.py +++ b/mypy/test/test_find_sources.py @@ -1,13 +1,14 @@ from mypy.modulefinder import BuildSource import os -from typing import Any, List, Optional, Set, Tuple, cast +from typing import List, Optional, Set, Tuple from unittest import TestCase from mypy.find_sources import SourceFinder +from mypy.fscache import FileSystemCache from mypy.modulefinder import BuildSource from mypy.options import Options -class _FakeFSCache: +class FakeFSCache(FileSystemCache): def __init__(self, files: Set[str]) -> None: assert all(os.path.isabs(f) for f in files) self.files = files @@ -29,9 +30,6 @@ def init_under_package_root(self, file: str) -> bool: return False -FakeFSCache = cast(Any, _FakeFSCache) - - def normalise_build_source_list(sources: List[BuildSource]) -> List[Tuple[str, Optional[str]]]: return sorted((s.module, s.base_dir) for s in sources)