Skip to content

Commit

Permalink
actually inherit from FileSystemCache to appease mypyc
Browse files Browse the repository at this point in the history
This means we could accidentally fallback to calling a FileSystemCache
method if stuff gets moved around.
  • Loading branch information
hauntsaninja committed Nov 22, 2020
1 parent dec730a commit 7b3d52a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mypy/test/test_find_sources.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 7b3d52a

Please sign in to comment.