mirror of
https://github.com/python/cpython.git
synced 2026-05-06 04:37:33 -04:00
gh-148406: Fix annotations of _colorize.FancyCompleter (#148408)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
+16
-15
@@ -1,3 +1,4 @@
|
||||
import builtins
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -202,25 +203,25 @@ class Difflib(ThemeSection):
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class FancyCompleter(ThemeSection):
|
||||
# functions and methods
|
||||
function: str = ANSIColors.BOLD_BLUE
|
||||
builtin_function_or_method: str = ANSIColors.BOLD_BLUE
|
||||
method: str = ANSIColors.BOLD_CYAN
|
||||
method_wrapper: str = ANSIColors.BOLD_CYAN
|
||||
wrapper_descriptor: str = ANSIColors.BOLD_CYAN
|
||||
method_descriptor: str = ANSIColors.BOLD_CYAN
|
||||
function: builtins.str = ANSIColors.BOLD_BLUE
|
||||
builtin_function_or_method: builtins.str = ANSIColors.BOLD_BLUE
|
||||
method: builtins.str = ANSIColors.BOLD_CYAN
|
||||
method_wrapper: builtins.str = ANSIColors.BOLD_CYAN
|
||||
wrapper_descriptor: builtins.str = ANSIColors.BOLD_CYAN
|
||||
method_descriptor: builtins.str = ANSIColors.BOLD_CYAN
|
||||
|
||||
# numbers
|
||||
int: str = ANSIColors.BOLD_YELLOW
|
||||
float: str = ANSIColors.BOLD_YELLOW
|
||||
complex: str = ANSIColors.BOLD_YELLOW
|
||||
bool: str = ANSIColors.BOLD_YELLOW
|
||||
int: builtins.str = ANSIColors.BOLD_YELLOW
|
||||
float: builtins.str = ANSIColors.BOLD_YELLOW
|
||||
complex: builtins.str = ANSIColors.BOLD_YELLOW
|
||||
bool: builtins.str = ANSIColors.BOLD_YELLOW
|
||||
|
||||
# others
|
||||
type: str = ANSIColors.BOLD_MAGENTA
|
||||
module: str = ANSIColors.CYAN
|
||||
NoneType: str = ANSIColors.GREY
|
||||
bytes: str = ANSIColors.BOLD_GREEN
|
||||
str: str = ANSIColors.BOLD_GREEN
|
||||
type: builtins.str = ANSIColors.BOLD_MAGENTA
|
||||
module: builtins.str = ANSIColors.CYAN
|
||||
NoneType: builtins.str = ANSIColors.GREY
|
||||
bytes: builtins.str = ANSIColors.BOLD_GREEN
|
||||
str: builtins.str = ANSIColors.BOLD_GREEN
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
|
||||
@@ -5,6 +5,7 @@ import sys
|
||||
import unittest
|
||||
import unittest.mock
|
||||
import _colorize
|
||||
from test.support import cpython_only, import_helper
|
||||
from test.support.os_helper import EnvironmentVarGuard
|
||||
|
||||
|
||||
@@ -22,6 +23,15 @@ def supports_virtual_terminal():
|
||||
return contextlib.nullcontext()
|
||||
|
||||
|
||||
class TestImportTime(unittest.TestCase):
|
||||
|
||||
@cpython_only
|
||||
def test_lazy_import(self):
|
||||
import_helper.ensure_lazy_imports(
|
||||
"_colorize", {"copy", "re"}
|
||||
)
|
||||
|
||||
|
||||
class TestTheme(unittest.TestCase):
|
||||
|
||||
def test_attributes(self):
|
||||
|
||||
Reference in New Issue
Block a user