mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
PY-74116 Move other tests on completion of importable name from typing to Py3CompletionTest
And make their setup similar to testParenthesesAreNotInsertedAfterNamesDefinedAsFunctionsInTypingPy. typing.py in the test directory has higher priority than typing.pyi in Typeshed, as a user .py file (see PyResolveImportUtil.Priority), so PyResolveImportUtil.resolveQualifiedName can't find typing.pyi, and it's not used in the tests. GitOrigin-RevId: 3dd51af04f5e5e16e7167dea32b248bca240b18e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cb6906c311
commit
ccd7847c0a
@@ -2197,20 +2197,6 @@ public abstract class PythonCommonCompletionTest extends PythonCommonTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
// PY-62208
|
||||
public void testImportableFunctionsFromTypingSuggestedInsideTypeHints() {
|
||||
runWithLanguageLevel(LanguageLevel.getLatest(), () -> {
|
||||
doMultiFileTest();
|
||||
});
|
||||
}
|
||||
|
||||
// PY-62208
|
||||
public void testImportableVariablesFromTypingSuggestedInsideTypeHints() {
|
||||
runWithLanguageLevel(LanguageLevel.getLatest(), () -> {
|
||||
doMultiFileTest();
|
||||
});
|
||||
}
|
||||
|
||||
// PY-62208
|
||||
public void testImportableFunctionsAndVariablesNotSuggestedInsidePatterns() {
|
||||
runWithLanguageLevel(LanguageLevel.getLatest(), () -> {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
@_SpecialForm
|
||||
def Final(self, parameters):
|
||||
"""Special typing construct to indicate final names to type checkers.
|
||||
|
||||
A final name cannot be re-assigned or overridden in a subclass.
|
||||
|
||||
For example::
|
||||
|
||||
MAX_SIZE: Final = 9000
|
||||
MAX_SIZE += 1 # Error reported by type checker
|
||||
|
||||
class Connection:
|
||||
TIMEOUT: Final[int] = 10
|
||||
|
||||
class FastConnector(Connection):
|
||||
TIMEOUT = 1 # Error reported by type checker
|
||||
|
||||
There is no runtime checking of these properties.
|
||||
"""
|
||||
item = _type_check(parameters, f'{self} accepts only single type.')
|
||||
return _GenericAlias(self, (item,))
|
||||
@@ -1,12 +0,0 @@
|
||||
Tuple = _TupleType(tuple, -1, inst=False, name='Tuple')
|
||||
Tuple.__doc__ = \
|
||||
"""Deprecated alias to builtins.tuple.
|
||||
|
||||
Tuple[X, Y] is the cross-product type of X and Y.
|
||||
|
||||
Example: Tuple[T1, T2] is a tuple of two elements corresponding
|
||||
to type variables T1 and T2. Tuple[int, float, str] is a tuple
|
||||
of an int, a float and a string.
|
||||
|
||||
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
|
||||
"""
|
||||
@@ -764,7 +764,26 @@ public class Py3CompletionTest extends PyTestCase {
|
||||
def TypedDict(typename, fields=None, /, *, total=True, **kwargs):
|
||||
...
|
||||
""", ignored -> {
|
||||
doMultiFileTest();
|
||||
doTest();
|
||||
});
|
||||
}
|
||||
|
||||
// PY-62208
|
||||
public void testImportableFunctionsFromTypingSuggestedInsideTypeHints() {
|
||||
runWithAdditionalFileInLibDir("typing.py", """
|
||||
def Final(self, parameters):
|
||||
...
|
||||
""", ignored -> {
|
||||
doTest();
|
||||
});
|
||||
}
|
||||
|
||||
// PY-62208
|
||||
public void testImportableVariablesFromTypingSuggestedInsideTypeHints() {
|
||||
runWithAdditionalFileInLibDir("typing.py", """
|
||||
Tuple = _TupleType(tuple, -1, inst=False, name='Tuple')
|
||||
""", ignored -> {
|
||||
doTest();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user