|
| 1 | +import re |
1 | 2 | import unittest |
2 | | -from _typeshed import Incomplete |
3 | | -from configparser import ConfigParser |
| 3 | +from _typeshed import Incomplete, StrPath, Unused |
| 4 | +from configparser import ConfigParser, _SectionName |
| 5 | +from types import ModuleType |
4 | 6 | from typing import Final, Literal |
5 | 7 |
|
6 | 8 | __version__: Final[str] |
7 | 9 |
|
8 | | -def haveRenderPM(): ... |
9 | | -def isWritable(D): ... |
| 10 | +def invariantSeed(n: float | str | bytes | bytearray | None) -> None: ... |
| 11 | +def haveRenderPM() -> ModuleType | Literal[False]: ... |
10 | 12 |
|
11 | | -RL_HOME: Incomplete |
12 | | -testsFolder: Incomplete |
13 | | - |
14 | | -DEJAVUSANS: tuple[ |
15 | | - Literal["DejaVuSans"], Literal["DejaVuSans-Bold"], Literal["DejaVuSans-Oblique"], Literal["DejaVuSans-BoldOblique"] |
16 | | -] = ... |
| 13 | +DEJAVUSANS: Final = ("DejaVuSans", "DejaVuSans-Bold", "DejaVuSans-Oblique", "DejaVuSans-BoldOblique") |
17 | 14 |
|
18 | 15 | def haveDejaVu() -> bool: ... |
19 | | -def setOutDir(name): ... |
20 | | -def mockUrlRead(name): ... |
21 | | -def outputfile(fn): ... |
| 16 | +def isWritable(D: Unused) -> Literal[0, 1]: ... |
| 17 | + |
| 18 | +RL_HOME: str | None |
| 19 | +testsFolder: str | None |
| 20 | + |
| 21 | +def setOutDir(name: str) -> str: ... |
| 22 | +def mockUrlRead(name: str): ... |
| 23 | +def outputfile(fn: StrPath | None) -> str: ... |
22 | 24 | def printLocation(depth: int = 1) -> None: ... |
23 | | -def makeSuiteForClasses(*classes, testMethodPrefix=None): ... |
24 | | -def getCVSEntries(folder, files: int = 1, folders: int = 0): ... |
| 25 | +def makeSuiteForClasses(*classes: type[unittest.TestCase], testMethodPrefix: str | None = None) -> unittest.TestSuite: ... |
| 26 | +def getCVSEntries(folder: StrPath, files: bool | Literal[1, 0] = 1, folders: bool | Literal[1, 0] = 0) -> list[str]: ... |
25 | 27 |
|
26 | 28 | class ExtConfigParser(ConfigParser): |
27 | | - pat: Incomplete |
28 | | - def getstringlist(self, section, option): ... |
| 29 | + pat: re.Pattern[str] |
| 30 | + def getstringlist(self, section: _SectionName, option: str): ... |
29 | 31 |
|
30 | 32 | class GlobDirectoryWalker: |
31 | 33 | index: int |
32 | | - pattern: Incomplete |
33 | | - stack: Incomplete |
34 | | - files: Incomplete |
35 | | - directory: Incomplete |
36 | | - def __init__(self, directory, pattern: str = "*") -> None: ... |
37 | | - def __getitem__(self, index): ... |
| 34 | + pattern: str |
| 35 | + stack: list[str] |
| 36 | + files: list[str] |
| 37 | + directory: str |
| 38 | + def __init__(self, directory: str, pattern: str = "*") -> None: ... |
| 39 | + def __getitem__(self, index) -> str | None: ... |
38 | 40 | def filterFiles(self, folder, files): ... |
39 | 41 |
|
40 | 42 | class RestrictedGlobDirectoryWalker(GlobDirectoryWalker): |
@@ -64,9 +66,9 @@ class ScriptThatMakesFileTest(unittest.TestCase): |
64 | 66 | def tearDown(self) -> None: ... |
65 | 67 | def runTest(self) -> None: ... |
66 | 68 |
|
67 | | -def equalStrings(a, b, enc: str = "utf8"): ... |
| 69 | +def equalStrings(a: str | bytes, b: str | bytes, enc: str = "utf8") -> bool: ... |
68 | 70 | def eqCheck(r, x) -> None: ... |
69 | | -def rlextraNeeded(): ... |
| 71 | +def rlextraNeeded() -> bool: ... |
70 | 72 | def rlSkipIf(cond, reason, __module__=None): ... |
71 | 73 | def rlSkipUnless(cond, reason, __module__=None): ... |
72 | 74 | def rlSkip(reason, __module__=None): ... |
0 commit comments