mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
mypy_test.py: rework filter, exclude and --dir arguments (#8711)
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
"""Utilities that are imported by multiple scripts in the tests directory."""
|
||||
|
||||
import os
|
||||
import re
|
||||
from functools import cache
|
||||
from pathlib import Path
|
||||
from typing import NamedTuple
|
||||
|
||||
import tomli
|
||||
|
||||
|
||||
def strip_comments(text: str) -> str:
|
||||
return text.split("#")[0].strip()
|
||||
|
||||
|
||||
try:
|
||||
from termcolor import colored as colored
|
||||
except ImportError:
|
||||
@@ -46,6 +52,14 @@ def read_dependencies(distribution: str) -> tuple[str, ...]:
|
||||
return tuple(dependencies)
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Parsing the stdlib/VERSIONS file
|
||||
# ====================================================================
|
||||
|
||||
|
||||
VERSIONS_RE = re.compile(r"^([a-zA-Z_][a-zA-Z0-9_.]*): ([23]\.\d{1,2})-([23]\.\d{1,2})?$")
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Getting test-case directories from package names
|
||||
# ====================================================================
|
||||
|
||||
Reference in New Issue
Block a user