diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-01-15 18:24:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 18:24:20 -0700 |
commit | bf4ac1f81defc727165da4ae5bfea198c75e82f7 (patch) | |
tree | f5a04136d974c6ba3742934ae97fcf18ad5e971b /numpy | |
parent | 5c7002926ec8ad12785b36024f9da80b7017ad1c (diff) | |
parent | a891c07d040067d42e35b25c558f0969cca2715c (diff) | |
download | numpy-bf4ac1f81defc727165da4ae5bfea198c75e82f7.tar.gz |
Merge pull request #18173 from BvB93/clear_cache
TST: Clear the mypy cache before running any typing tests
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/typing/tests/test_typing.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/typing/tests/test_typing.py b/numpy/typing/tests/test_typing.py index 361688c5d..18520a757 100644 --- a/numpy/typing/tests/test_typing.py +++ b/numpy/typing/tests/test_typing.py @@ -2,6 +2,7 @@ import importlib.util import itertools import os import re +import shutil from collections import defaultdict from typing import Optional, IO, Dict, List @@ -25,6 +26,15 @@ MYPY_INI = os.path.join(DATA_DIR, "mypy.ini") CACHE_DIR = os.path.join(DATA_DIR, ".mypy_cache") +@pytest.mark.slow +@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed") +@pytest.fixture(scope="session", autouse=True) +def clear_cache() -> None: + """Clears the mypy cache before running any of the typing tests.""" + if os.path.isdir(CACHE_DIR): + shutil.rmtree(CACHE_DIR) + + def get_test_cases(directory): for root, _, files in os.walk(directory): for fname in files: |