mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix Python tests after the proofreading
GitOrigin-RevId: 2f6eb873d6321ef00d293377ec2c97195f72da21
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eca9010147
commit
de08c2a947
@@ -3,8 +3,6 @@ QFIX.optimize.imports=Optimize imports
|
||||
|
||||
QFIX.add.import.add.import=Add "''{0}''"
|
||||
|
||||
QFIX.statement.effect.introduce.variable=Introduce a variable
|
||||
|
||||
#PyImplementMethodsQuickFix
|
||||
QFIX.NAME.implement.methods=Implement abstract methods
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<warning descr="Bad or unknown command. make sure this command really exists.">bad_command</warning> positional_argument --available-option=available_argument
|
||||
<warning descr="Bad or unknown command. Ensure this command exists.">bad_command</warning> positional_argument --available-option=available_argument
|
||||
@@ -1 +1 @@
|
||||
command <warning descr="Argument can't have this value. use autocompletion to check list of possible values.">bad_positional_value</warning> --available-option=<warning descr="Argument can't have this value. use autocompletion to check list of possible values.">bad_argument</warning> <warning descr="Bad or unknown option. make sure this option really exists.">--bad-option</warning> <warning descr="Excess argument or argument is not possible here">unexpected_argument</warning> --option-no-argument=<warning descr="Excess argument or argument is not possible here">asd</warning>
|
||||
command <warning descr="Argument cannot have this value. Use autocompletion to check the list of possible values.">bad_positional_value</warning> --available-option=<warning descr="Argument cannot have this value. Use autocompletion to check the list of possible values.">bad_argument</warning> <warning descr="Bad or unknown option. Ensure this option exists.">--bad-option</warning> <warning descr="Excess argument or argument is not possible here">unexpected_argument</warning> --option-no-argument=<warning descr="Excess argument or argument is not possible here">asd</warning>
|
||||
@@ -4,6 +4,6 @@ FILE
|
||||
PsiWhiteSpace(' ')
|
||||
CommandLineOptionImpl(OPTION)
|
||||
PsiElement(LONG_OPTION_NAME_TOKEN)('--bad_value')
|
||||
PsiErrorElement:Space between argument and its value is unexpected
|
||||
PsiErrorElement:Space between an argument and its value is unexpected
|
||||
<empty list>
|
||||
PsiElement(=)('=')
|
||||
@@ -4,7 +4,7 @@ PyFile:magicError.py
|
||||
PsiElement(Py:IDENTIFIER)('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiErrorElement:Multiline magic can't be used as an expression
|
||||
PsiErrorElement:Multiline magic cannot be used as an expression
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PyEmptyExpression
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
with open("") as <error descr="Can't assign to operator">my_<<var</error>:
|
||||
with open("") as <error descr="Cannot assign to operator">my_<<var</error>:
|
||||
pass
|
||||
@@ -1,31 +1,31 @@
|
||||
# fail
|
||||
|
||||
<error descr="Can't assign to function call">int(1)</error> = 1
|
||||
<error descr="Cannot assign to function call">int(1)</error> = 1
|
||||
|
||||
<error descr="Can't assign to literal">12</error> = 1
|
||||
<error descr="Cannot assign to literal">12</error> = 1
|
||||
|
||||
<error descr="Can't assign to operator">1 + 21</error> = 12
|
||||
<error descr="Cannot assign to operator">1 + 21</error> = 12
|
||||
|
||||
result = <error descr="Can't assign to operator">a < c and c</error> = 4
|
||||
result = <error descr="Cannot assign to operator">a < c and c</error> = 4
|
||||
|
||||
<error descr="Can't assign to ()">()</error> = 123
|
||||
<error descr="Cannot assign to ()">()</error> = 123
|
||||
[] = 1
|
||||
[<error descr="Can't assign to literal">1</error>] = 1
|
||||
<error descr="Can't assign to literal">{}</error> = 1
|
||||
<error descr="Can't assign to literal">{1, 2, 3}</error> = 1
|
||||
[<error descr="Cannot assign to literal">1</error>] = 1
|
||||
<error descr="Cannot assign to literal">{}</error> = 1
|
||||
<error descr="Cannot assign to literal">{1, 2, 3}</error> = 1
|
||||
|
||||
(<error descr="Can't assign to literal">1</error>,(<error descr="Can't assign to literal">2</error>, <error descr="Can't assign to literal">3</error>)) = 3,(4,5)
|
||||
del <error descr="Can't delete literal">1</error>
|
||||
del <error descr="Can't delete function call">int()</error>
|
||||
(<error descr="Cannot assign to literal">1</error>,(<error descr="Cannot assign to literal">2</error>, <error descr="Cannot assign to literal">3</error>)) = 3,(4,5)
|
||||
del <error descr="Cannot delete literal">1</error>
|
||||
del <error descr="Cannot delete function call">int()</error>
|
||||
|
||||
for <error descr="Can't assign to literal">1</error> in []:
|
||||
for <error descr="Cannot assign to literal">1</error> in []:
|
||||
pass
|
||||
|
||||
for (<error descr="Can't assign to literal">1</error>,(<error descr="Can't assign to literal">2</error>,)) in [12]:
|
||||
for (<error descr="Cannot assign to literal">1</error>,(<error descr="Cannot assign to literal">2</error>,)) in [12]:
|
||||
pass
|
||||
|
||||
<error descr="Augmented assign to dict comprehension not possible">{ x: y for y, x in ((1, 2), (3, 4)) }</error> += 5
|
||||
<error descr="Can't assign to set comprehension">{ x for x in (1, 2) }</error> = 5
|
||||
<error descr="Cannot assign to set comprehension">{ x for x in (1, 2) }</error> = 5
|
||||
|
||||
# ok
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ async def f42(x):
|
||||
|
||||
|
||||
async def f43(x):
|
||||
y = {z: 10 for <error descr="Can't assign to await expression">await z</error> in []} # fail
|
||||
y = {z: 10 for <error descr="Cannot assign to await expression">await z</error> in []} # fail
|
||||
await x
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ async def f42(x):
|
||||
|
||||
|
||||
async def f43(x):
|
||||
y = {z: 10 for <error descr="Can't assign to await expression">await z</error> in []} # fail
|
||||
y = {z: 10 for <error descr="Cannot assign to await expression">await z</error> in []} # fail
|
||||
await x
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ async def f42(x):
|
||||
|
||||
|
||||
async def f43(x):
|
||||
y = (z for <error descr="Can't assign to await expression">await z</error> in []) # fail
|
||||
y = (z for <error descr="Cannot assign to await expression">await z</error> in []) # fail
|
||||
await x
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ async def f42(x):
|
||||
|
||||
|
||||
async def f43(x):
|
||||
y = [z for <error descr="Can't assign to await expression">await z</error> in []] # fail
|
||||
y = [z for <error descr="Cannot assign to await expression">await z</error> in []] # fail
|
||||
await x
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ async def f42(x):
|
||||
|
||||
|
||||
async def f43(x):
|
||||
y = [z for <error descr="Can't assign to await expression">await z</error> in []] # fail
|
||||
y = [z for <error descr="Cannot assign to await expression">await z</error> in []] # fail
|
||||
await x
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ async def f42(x):
|
||||
|
||||
|
||||
async def f43(x):
|
||||
y = {z for <error descr="Can't assign to await expression">await z</error> in []} # fail
|
||||
y = {z for <error descr="Cannot assign to await expression">await z</error> in []} # fail
|
||||
await x
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ async def f42(x):
|
||||
|
||||
|
||||
async def f43(x):
|
||||
y = {z for <error descr="Can't assign to await expression">await z</error> in []} # fail
|
||||
y = {z for <error descr="Cannot assign to await expression">await z</error> in []} # fail
|
||||
await x
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
f'{42!r}'
|
||||
f'{42!s}'
|
||||
f'{42!a}'
|
||||
f'{42<error descr="Illegal conversion character 'z': should be one of 's', 'r', 'a'">!z</error>}'
|
||||
f'{42<error descr="Illegal conversion character 'foo': should be one of 's', 'r', 'a'">!foo</error>}'
|
||||
f'{42<error descr="Conversion character is expected: should be one of 's', 'r', 'a'">!</error>}'
|
||||
f'{42<error descr="Conversion character is expected: should be one of 's', 'r', 'a'">!</error>:2}'
|
||||
f'{42<error descr="Conversion character is expected: should be one of 's', 'r', 'a'">!</error><error descr="'}' expected">'</error>
|
||||
f'{42<error descr="Conversion character is expected: should be one of 's', 'r', 'a'">!</error><EOLError descr=": or '}' expected"></EOLError><EOLError descr="' expected"></EOLError>
|
||||
f'{42<error descr="An illegal conversion character 'z': should be one of 's', 'r', 'a'">!z</error>}'
|
||||
f'{42<error descr="An illegal conversion character 'foo': should be one of 's', 'r', 'a'">!foo</error>}'
|
||||
f'{42<error descr="A conversion character is expected: should be one of 's', 'r', 'a'">!</error>}'
|
||||
f'{42<error descr="A conversion character is expected: should be one of 's', 'r', 'a'">!</error>:2}'
|
||||
f'{42<error descr="A conversion character is expected: should be one of 's', 'r', 'a'">!</error><error descr="'}' expected">'</error>
|
||||
f'{42<error descr="A conversion character is expected: should be one of 's', 'r', 'a'">!</error><EOLError descr=": or '}' expected"></EOLError><EOLError descr="' expected"></EOLError>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
f'<error descr="Single '}' is not allowed inside f-strings">}</error>'
|
||||
f'{x}{y}<error descr="Single '}' is not allowed inside f-strings">}</error>'
|
||||
f'{x}}}<error descr="Single '}' is not allowed inside f-strings">}</error>'
|
||||
f'{x:{y}}<error descr="Single '}' is not allowed inside f-strings">}</error>'
|
||||
f'<error descr="A single '}' is not allowed inside f-strings">}</error>'
|
||||
f'{x}{y}<error descr="A single '}' is not allowed inside f-strings">}</error>'
|
||||
f'{x}}}<error descr="A single '}' is not allowed inside f-strings">}</error>'
|
||||
f'{x:{y}}<error descr="A single '}' is not allowed inside f-strings">}</error>'
|
||||
f'{x:{y}}}}'
|
||||
f'{"}":{"}"}}'
|
||||
f'\N{FOO BAR}'
|
||||
@@ -1,7 +1,7 @@
|
||||
f'{x:{y:<error descr="Expression fragment inside f-string is nested too deeply">{<error descr="Expression expected">}</error></error>}}'
|
||||
f'{x:{y:<error descr="Expression fragment inside f-string is nested too deeply">{<error descr="Expression expected"><error descr="Expression fragments inside f-strings cannot include line comments"># foo}}}'</error></error></error><EOLError descr="Type conversion, ':' or '}' expected"></EOLError><EOLError descr="' expected"></EOLError>
|
||||
f'{x:{y:<error descr="Expression fragment inside f-string is nested too deeply">{z<error descr="Illegal conversion character 'z': should be one of 's', 'r', 'a'">!z</error>}</error>}}'
|
||||
f'{x:{y:<error descr="Expression fragment inside f-string is nested too deeply">{z:<error descr="Expression fragment inside f-string is nested too deeply">{42}</error>}</error>}}'
|
||||
f'{<error descr="Expression expected">:</error>{<error descr="Expression expected">:</error><error descr="Expression fragment inside f-string is nested too deeply">{<error descr="Expression expected">:</error><error descr="Expression fragment inside f-string is nested too deeply">{<error descr="Expression expected">}</error></error>}</error>}}'
|
||||
f'{x:{y:<error descr="Expression fragment inside f-string is nested too deeply">{z</error><error descr="'}' expected">'</error>
|
||||
f'{x:{y:<error descr="Expression fragment inside f-string is nested too deeply">{z</error><EOLError descr="Type conversion, ':' or '}' expected"></EOLError><EOLError descr="' expected"></EOLError>
|
||||
f'{x:{y:<error descr="Expression fragment inside an f-string is nested too deeply">{<error descr="Expression expected">}</error></error>}}'
|
||||
f'{x:{y:<error descr="Expression fragment inside an f-string is nested too deeply">{<error descr="Expression expected"><error descr="Expression fragments inside f-strings cannot include line comments"># foo}}}'</error></error></error><EOLError descr="Type conversion, ':' or '}' expected"></EOLError><EOLError descr="' expected"></EOLError>
|
||||
f'{x:{y:<error descr="Expression fragment inside an f-string is nested too deeply">{z<error descr="An illegal conversion character 'z': should be one of 's', 'r', 'a'">!z</error>}</error>}}'
|
||||
f'{x:{y:<error descr="Expression fragment inside an f-string is nested too deeply">{z:<error descr="Expression fragment inside an f-string is nested too deeply">{42}</error>}</error>}}'
|
||||
f'{<error descr="Expression expected">:</error>{<error descr="Expression expected">:</error><error descr="Expression fragment inside an f-string is nested too deeply">{<error descr="Expression expected">:</error><error descr="Expression fragment inside an f-string is nested too deeply">{<error descr="Expression expected">}</error></error>}</error>}}'
|
||||
f'{x:{y:<error descr="Expression fragment inside an f-string is nested too deeply">{z</error><error descr="'}' expected">'</error>
|
||||
f'{x:{y:<error descr="Expression fragment inside an f-string is nested too deeply">{z</error><EOLError descr="Type conversion, ':' or '}' expected"></EOLError><EOLError descr="' expected"></EOLError>
|
||||
@@ -3,10 +3,10 @@
|
||||
x['foo']: str
|
||||
f(42).attr: dict
|
||||
|
||||
<error descr="Illegal target for variable annotation">2 ** 8</error>: int
|
||||
<error descr="Illegal target for variable annotation">f()</error>: bool
|
||||
<error descr="Variable annotation cannot be combined with tuple unpacking">x, y, z</error>: Tuple[int, ...]
|
||||
(<error descr="Variable annotation cannot be combined with tuple unpacking">x, y, z</error>): Tuple[int, int, int]
|
||||
<error descr="Variable annotation cannot be combined with tuple unpacking">[x, y, z]</error>: Tuple[Any, Any, Any]
|
||||
<error descr="Variable annotation cannot be combined with tuple unpacking">x, *xs</error>: tuple = range(10)
|
||||
<error descr="Variable annotation cannot be used in assignment with multiple targets">x:int = y = 42</error>
|
||||
<error descr="An illegal target for a variable annotation">2 ** 8</error>: int
|
||||
<error descr="An illegal target for a variable annotation">f()</error>: bool
|
||||
<error descr="A variable annotation cannot be combined with tuple unpacking">x, y, z</error>: Tuple[int, ...]
|
||||
(<error descr="A variable annotation cannot be combined with tuple unpacking">x, y, z</error>): Tuple[int, int, int]
|
||||
<error descr="A variable annotation cannot be combined with tuple unpacking">[x, y, z]</error>: Tuple[Any, Any, Any]
|
||||
<error descr="A variable annotation cannot be combined with tuple unpacking">x, *xs</error>: tuple = range(10)
|
||||
<error descr="A variable annotation cannot be used in assignment with multiple targets">x:int = y = 42</error>
|
||||
@@ -4,5 +4,5 @@ class Base:
|
||||
|
||||
|
||||
class Sub(Base):
|
||||
def m<warning descr="Signature of method 'Sub.m()' does not match signature of base method in class 'Base'">(<caret>self)</warning>:
|
||||
def m<warning descr="Signature of method 'Sub.m()' does not match signature of the base method in class 'Base'">(<caret>self)</warning>:
|
||||
pass
|
||||
@@ -1,5 +1,5 @@
|
||||
<weak_warning descr="Missing docstring"></weak_warning><warning descr="No encoding specified for file"></warning>def <weak_warning descr="Missing docstring">f</weak_warning>(x):
|
||||
<warning descr="Non-ASCII character 'М' in file, but no encoding declared"># type: (b'Моноцикл') -> None</warning>
|
||||
<warning descr="Non-ASCII character 'М' in the file, but no encoding declared"># type: (b'Моноцикл') -> None</warning>
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
def foo(a, b = 345, c = 1):
|
||||
pass
|
||||
|
||||
foo(1, <weak_warning descr="Argument equals to default parameter value">345</weak_warning>, 22)
|
||||
foo(1, <weak_warning descr="Argument equals to the default parameter value">345</weak_warning>, 22)
|
||||
|
||||
def foo(a = None):
|
||||
pass
|
||||
foo(<weak_warning descr="Argument equals to default parameter value">a = None</weak_warning>)
|
||||
foo(<weak_warning descr="Argument equals to the default parameter value">a = None</weak_warning>)
|
||||
|
||||
def bar(a = 2, b = 3):
|
||||
pass
|
||||
|
||||
#PY-3260
|
||||
bar(<weak_warning descr="Argument equals to default parameter value">a = 2</weak_warning>, <weak_warning descr="Argument equals to default parameter value">b = 3</weak_warning>)
|
||||
bar(<weak_warning descr="Argument equals to the default parameter value">a = 2</weak_warning>, <weak_warning descr="Argument equals to the default parameter value">b = 3</weak_warning>)
|
||||
|
||||
class A:
|
||||
@classmethod
|
||||
@@ -20,7 +20,7 @@ class A:
|
||||
|
||||
a = A()
|
||||
|
||||
a.foo(<weak_warning descr="Argument equals to default parameter value">1</weak_warning>)
|
||||
a.foo(<weak_warning descr="Argument equals to the default parameter value">1</weak_warning>)
|
||||
|
||||
|
||||
class C(object):
|
||||
@@ -34,7 +34,7 @@ class C(object):
|
||||
def delx(self):
|
||||
del self._x
|
||||
|
||||
x = property(getx, <weak_warning descr="Argument equals to default parameter value">None</weak_warning>, fdel = delx, doc = "I'm the 'x' property.")
|
||||
x = property(getx, <weak_warning descr="Argument equals to the default parameter value">None</weak_warning>, fdel = delx, doc = "I'm the 'x' property.")
|
||||
|
||||
|
||||
# PY-3455
|
||||
@@ -52,7 +52,7 @@ class OptionParser(optparse.OptionParser):
|
||||
def bar(a = "qwer"):
|
||||
pass
|
||||
|
||||
bar(<weak_warning descr="Argument equals to default parameter value">a = 'qwer'</weak_warning>)
|
||||
bar(<weak_warning descr="Argument equals to the default parameter value">a = 'qwer'</weak_warning>)
|
||||
|
||||
getattr(bar, "__doc__", None) # None is not highlighted
|
||||
|
||||
@@ -63,7 +63,7 @@ class a:
|
||||
kw = a()
|
||||
|
||||
kw['customerPaymentProfileId'] = kw.get("customerPaymentProfileId",
|
||||
<weak_warning descr="Argument equals to default parameter value">None</weak_warning>)
|
||||
<weak_warning descr="Argument equals to the default parameter value">None</weak_warning>)
|
||||
|
||||
{1: 2}.get('foo', None) #pass
|
||||
{1: 2}.pop('foo', None) #pass
|
||||
@@ -83,16 +83,16 @@ def f2():
|
||||
def decorator(arg='baz'):
|
||||
return lambda x: x
|
||||
|
||||
@decorator(<weak_warning descr="Argument equals to default parameter value">arg='baz'</weak_warning>)
|
||||
@decorator(<weak_warning descr="Argument equals to the default parameter value">arg='baz'</weak_warning>)
|
||||
def f<error descr="'(' expected">:</error>
|
||||
pass
|
||||
|
||||
# PY-30335
|
||||
with open('file', <weak_warning descr="Argument equals to default parameter value">'r'</weak_warning>) as file:
|
||||
with open('file', <weak_warning descr="Argument equals to the default parameter value">'r'</weak_warning>) as file:
|
||||
pass
|
||||
|
||||
# PY-29731
|
||||
def py29731(p=True):
|
||||
pass
|
||||
|
||||
py29731(<weak_warning descr="Argument equals to default parameter value">True</weak_warning>)
|
||||
py29731(<weak_warning descr="Argument equals to the default parameter value">True</weak_warning>)
|
||||
@@ -2,4 +2,4 @@
|
||||
def py29731(p=True):
|
||||
pass
|
||||
|
||||
py29731(<weak_warning descr="Argument equals to default parameter value">True</weak_warning>)
|
||||
py29731(<weak_warning descr="Argument equals to the default parameter value">True</weak_warning>)
|
||||
@@ -1,44 +1,44 @@
|
||||
i = []
|
||||
for i[0] in xrange(5):
|
||||
for <weak_warning descr="Variable 'i[0]' already declared in 'for' loop or 'with' statement above">i[0]</weak_warning> in xrange(20, 25):
|
||||
for <weak_warning descr="Variable 'i[0]' is already declared in 'for' loop or 'with' statement above">i[0]</weak_warning> in xrange(20, 25):
|
||||
print("Inner", i)
|
||||
for <weak_warning descr="Variable 'i' already declared in 'for' loop or 'with' statement above">i</weak_warning> in xrange(20, 25):
|
||||
for <weak_warning descr="Variable 'i' is already declared in 'for' loop or 'with' statement above">i</weak_warning> in xrange(20, 25):
|
||||
pass
|
||||
print("Outer", i)
|
||||
|
||||
for i in xrange(5):
|
||||
for <weak_warning descr="Variable 'i' already declared in 'for' loop or 'with' statement above">i</weak_warning> in xrange(20, 25):
|
||||
for <weak_warning descr="Variable 'i' is already declared in 'for' loop or 'with' statement above">i</weak_warning> in xrange(20, 25):
|
||||
print("Inner", i)
|
||||
print("Outer", i)
|
||||
|
||||
for i in xrange(5):
|
||||
i = []
|
||||
for <weak_warning descr="Variable 'i[0]' already declared in 'for' loop or 'with' statement above">i[0]</weak_warning> in xrange(20, 25):
|
||||
for <weak_warning descr="Variable 'i[0]' is already declared in 'for' loop or 'with' statement above">i[0]</weak_warning> in xrange(20, 25):
|
||||
print("Inner", i)
|
||||
print("Outer", i)
|
||||
|
||||
i = [0]
|
||||
for i[0] in xrange(5):
|
||||
for <weak_warning descr="Variable 'i[0]' already declared in 'for' loop or 'with' statement above">i[0]</weak_warning> in xrange(20, 25):
|
||||
for <weak_warning descr="Variable 'i[0]' is already declared in 'for' loop or 'with' statement above">i[0]</weak_warning> in xrange(20, 25):
|
||||
print("Inner", i)
|
||||
print("Outer", i)
|
||||
|
||||
i = [[]]
|
||||
for i[0] in xrange(5):
|
||||
for <weak_warning descr="Variable 'i' already declared in 'for' loop or 'with' statement above">i</weak_warning> in xrange(20, 25):
|
||||
for <weak_warning descr="Variable 'i' is already declared in 'for' loop or 'with' statement above">i</weak_warning> in xrange(20, 25):
|
||||
print("Inner", i)
|
||||
print("Outer", i)
|
||||
|
||||
with open("a") as f:
|
||||
spam(f)
|
||||
f.eggs()
|
||||
with open("b") as <weak_warning descr="Variable 'f' already declared in 'for' loop or 'with' statement above">f</weak_warning>: #
|
||||
with open("b") as <weak_warning descr="Variable 'f' is already declared in 'for' loop or 'with' statement above">f</weak_warning>: #
|
||||
pass
|
||||
|
||||
with open("a") as z, open("A") as f:
|
||||
spam(f)
|
||||
f.eggs()
|
||||
for (a,b,c,d,(e,<weak_warning descr="Variable 'f' already declared in 'for' loop or 'with' statement above">f</weak_warning>)) in []:
|
||||
for (a,b,c,d,(e,<weak_warning descr="Variable 'f' is already declared in 'for' loop or 'with' statement above">f</weak_warning>)) in []:
|
||||
pass
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ with open("a") as f:
|
||||
f.eggs()
|
||||
for z in []:
|
||||
with open("b") as q:
|
||||
with open("a") as <weak_warning descr="Variable 'f' already declared in 'for' loop or 'with' statement above">f</weak_warning>: #
|
||||
with open("a") as <weak_warning descr="Variable 'f' is already declared in 'for' loop or 'with' statement above">f</weak_warning>: #
|
||||
pass
|
||||
|
||||
|
||||
@@ -58,18 +58,18 @@ class Foo(object):
|
||||
|
||||
def foo(self):
|
||||
for self.data in [1,2,3]:
|
||||
for <weak_warning descr="Variable 'self.data' already declared in 'for' loop or 'with' statement above">self.data</weak_warning> in [1,2,3]:
|
||||
for <weak_warning descr="Variable 'self.data' is already declared in 'for' loop or 'with' statement above">self.data</weak_warning> in [1,2,3]:
|
||||
pass
|
||||
|
||||
for elt in range(10):
|
||||
print elt
|
||||
else:
|
||||
for elt in range(10):
|
||||
for <weak_warning descr="Variable 'elt' already declared in 'for' loop or 'with' statement above">elt</weak_warning> in range(10):
|
||||
for <weak_warning descr="Variable 'elt' is already declared in 'for' loop or 'with' statement above">elt</weak_warning> in range(10):
|
||||
pass
|
||||
|
||||
for elt in range(10):
|
||||
for <weak_warning descr="Variable 'elt' already declared in 'for' loop or 'with' statement above">elt</weak_warning> in range(10):
|
||||
for <weak_warning descr="Variable 'elt' is already declared in 'for' loop or 'with' statement above">elt</weak_warning> in range(10):
|
||||
pass
|
||||
else:
|
||||
for elt in range(10):
|
||||
|
||||
@@ -1 +1 @@
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">var_1 = var_1 + 1</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">var_1 = var_1 + 1</weak_warning>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# PY-2488
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">a = a ** 1</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">a = a ** 1</weak_warning>
|
||||
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">x = x % 3</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">x = x | 3</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">x = x & 3</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">x = x ^ 3</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">x = x % 3</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">x = x | 3</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">x = x & 3</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">x = x ^ 3</weak_warning>
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# PY-2483
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">list[0] = list[0] + 1</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">list[0] = list[0] + 1</weak_warning>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">var = var * 2</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">var = var * 2</weak_warning>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
var_3 = var_3
|
||||
var_4 = 1
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">var_6 = var_6 + var_4</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">var_6 = var_6 + var_4</weak_warning>
|
||||
|
||||
#PY-2482
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">var = 2 + var</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">var = 2 + var</weak_warning>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
def expand(values1: list, values2: list):
|
||||
values1 = values2 + values1
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
|
||||
|
||||
def expand(values1, values2):
|
||||
@@ -8,7 +8,7 @@ def expand(values1, values2):
|
||||
b = values2[0]
|
||||
|
||||
values1 = values2 + values1
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
|
||||
|
||||
def expand(values1, values2):
|
||||
@@ -16,7 +16,7 @@ def expand(values1, values2):
|
||||
b = len(values2)
|
||||
|
||||
values1 = values2 + values1
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
|
||||
|
||||
def expand(values1, values2):
|
||||
@@ -27,7 +27,7 @@ def expand(values1, values2):
|
||||
print(b)
|
||||
|
||||
values1 = values2 + values1
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
|
||||
|
||||
def expand(values1, values2):
|
||||
@@ -35,4 +35,4 @@ def expand(values1, values2):
|
||||
b = 5 in values2
|
||||
|
||||
values1 = values2 + values1
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">values1 = values1 + values2</weak_warning>
|
||||
@@ -1,7 +1,7 @@
|
||||
str = "string"
|
||||
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">var_2 = var_2 + str</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">var_2 = var_2 + str</weak_warning>
|
||||
|
||||
var_3 = var_3
|
||||
var_4 = 1
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">var_5 = var_5 + "string"</weak_warning>
|
||||
<weak_warning descr="Assignment can be replaced with an augmented assignment">var_5 = var_5 + "string"</weak_warning>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Foo(base1, base2, <error descr="This syntax available only since py3">metaclass=mymeta</error>):
|
||||
class Foo(base1, base2, <error descr="This syntax available only since Python 3">metaclass=mymeta</error>):
|
||||
pass
|
||||
|
||||
class Foo(base1, base2):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dataclasses
|
||||
|
||||
|
||||
@dataclasses.dataclass(<error descr="'frozen' should be false if the class defines '__setattr__' or '__delattr__'">frozen=True</error>)
|
||||
@dataclasses.dataclass(<error descr="'frozen' should be False if the class defines '__setattr__' or '__delattr__'">frozen=True</error>)
|
||||
class A4:
|
||||
a: int = 1
|
||||
|
||||
@@ -19,7 +19,7 @@ class Derived4(Base4):
|
||||
d: int = 1
|
||||
|
||||
|
||||
@dataclasses.dataclass(<error descr="'frozen' should be false if the class defines '__setattr__' or '__delattr__'">frozen=True</error>)
|
||||
@dataclasses.dataclass(<error descr="'frozen' should be False if the class defines '__setattr__' or '__delattr__'">frozen=True</error>)
|
||||
class A2:
|
||||
a: int = 1
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dataclasses
|
||||
|
||||
|
||||
@dataclasses.dataclass(<error descr="'order' should be false if the class defines one of order methods">order=True</error>)
|
||||
@dataclasses.dataclass(<error descr="'order' should be False if the class defines one of order methods">order=True</error>)
|
||||
class A1:
|
||||
a: int = 1
|
||||
|
||||
@@ -19,7 +19,7 @@ class Derived1(Base1):
|
||||
d: int = 1
|
||||
|
||||
|
||||
@dataclasses.dataclass(<error descr="'order' should be false if the class defines one of order methods">order=True</error>)
|
||||
@dataclasses.dataclass(<error descr="'order' should be False if the class defines one of order methods">order=True</error>)
|
||||
class A2:
|
||||
a: int = 1
|
||||
|
||||
@@ -37,7 +37,7 @@ class Derived2(Base2):
|
||||
d: int = 1
|
||||
|
||||
|
||||
@dataclasses.dataclass(<error descr="'order' should be false if the class defines one of order methods">order=True</error>)
|
||||
@dataclasses.dataclass(<error descr="'order' should be False if the class defines one of order methods">order=True</error>)
|
||||
class A3:
|
||||
a: int = 1
|
||||
|
||||
@@ -55,7 +55,7 @@ class Derived3(Base3):
|
||||
d: int = 1
|
||||
|
||||
|
||||
@dataclasses.dataclass(<error descr="'order' should be false if the class defines one of order methods">order=True</error>)
|
||||
@dataclasses.dataclass(<error descr="'order' should be False if the class defines one of order methods">order=True</error>)
|
||||
class A4:
|
||||
a: int = 1
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dataclasses
|
||||
|
||||
|
||||
@dataclasses.dataclass(<error descr="'unsafe_hash' should be false if the class defines '__hash__'">unsafe_hash=True</error>)
|
||||
@dataclasses.dataclass(<error descr="'unsafe_hash' should be False if the class defines '__hash__'">unsafe_hash=True</error>)
|
||||
class A2:
|
||||
a: int = 1
|
||||
|
||||
@@ -19,7 +19,7 @@ class Derived2(Base2):
|
||||
d: int = 1
|
||||
|
||||
|
||||
@dataclasses.dataclass(<error descr="'unsafe_hash' should be false if the class defines '__hash__'">unsafe_hash=True</error>)
|
||||
@dataclasses.dataclass(<error descr="'unsafe_hash' should be False if the class defines '__hash__'">unsafe_hash=True</error>)
|
||||
class A1:
|
||||
a: int = 1
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ class C:
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
<warning descr="Decorator @classmethod on method outside class">@classmethod</warning>
|
||||
<warning descr="Decorator @classmethod on a method outside the class">@classmethod</warning>
|
||||
def foo(self):
|
||||
print ("Constructor C was called")
|
||||
+1
-1
@@ -3,7 +3,7 @@ class B(object):
|
||||
|
||||
class C(B):
|
||||
attr = 'baz'
|
||||
__slots__ = [<warning descr="'attr' in __slots__ conflicts with class variable">'attr'</warning>, 'bar']
|
||||
__slots__ = [<warning descr="'attr' in __slots__ conflicts with a class variable">'attr'</warning>, 'bar']
|
||||
|
||||
C.attr = 'spam'
|
||||
print(C.attr)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class Foo(object):
|
||||
attr = 'baz'
|
||||
__slots__ = [<warning descr="'attr' in __slots__ conflicts with class variable">'attr'</warning>, 'bar']
|
||||
__slots__ = [<warning descr="'attr' in __slots__ conflicts with a class variable">'attr'</warning>, 'bar']
|
||||
|
||||
Foo.attr = 'spam'
|
||||
print(Foo.attr)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class B(object):
|
||||
attr = 'baz'
|
||||
__slots__ = ['f', <warning descr="'attr' in __slots__ conflicts with class variable">'attr'</warning>, '__dict__']
|
||||
__slots__ = ['f', <warning descr="'attr' in __slots__ conflicts with a class variable">'attr'</warning>, '__dict__']
|
||||
|
||||
class C(B):
|
||||
__slots__ = ['foo', 'bar']
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class B(object):
|
||||
attr = 'baz'
|
||||
__slots__ = [<warning descr="'attr' in __slots__ conflicts with class variable">'attr'</warning>, 'b']
|
||||
__slots__ = [<warning descr="'attr' in __slots__ conflicts with a class variable">'attr'</warning>, 'b']
|
||||
|
||||
class C(B):
|
||||
__slots__ = ['foo', 'bar']
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class B(object):
|
||||
attr = 'baz'
|
||||
__slots__ = ['f', <warning descr="'attr' in __slots__ conflicts with class variable">'attr'</warning>]
|
||||
__slots__ = ['f', <warning descr="'attr' in __slots__ conflicts with a class variable">'attr'</warning>]
|
||||
|
||||
class C(B):
|
||||
__slots__ = ['foo', 'bar', '__dict__']
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo(object):
|
||||
__slots__ = <warning descr="'foo' in __slots__ conflicts with class variable">'foo'</warning>
|
||||
__slots__ = <warning descr="'foo' in __slots__ conflicts with a class variable">'foo'</warning>
|
||||
foo = 1
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo(object):
|
||||
__slots__ = [<warning descr="'foo' in __slots__ conflicts with class variable">'foo'</warning>]
|
||||
__slots__ = [<warning descr="'foo' in __slots__ conflicts with a class variable">'foo'</warning>]
|
||||
foo = 1
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo(object):
|
||||
__slots__ = (<warning descr="'foo' in __slots__ conflicts with class variable">'foo'</warning>)
|
||||
__slots__ = (<warning descr="'foo' in __slots__ conflicts with a class variable">'foo'</warning>)
|
||||
foo = 1
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo(object):
|
||||
__slots__ = [<warning descr="'foo' in __slots__ conflicts with class variable">'foo'</warning>, 'bar']
|
||||
__slots__ = [<warning descr="'foo' in __slots__ conflicts with a class variable">'foo'</warning>, 'bar']
|
||||
foo = 1
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo(object):
|
||||
__slots__ = (<warning descr="'foo' in __slots__ conflicts with class variable">'foo'</warning>, 'bar')
|
||||
__slots__ = (<warning descr="'foo' in __slots__ conflicts with a class variable">'foo'</warning>, 'bar')
|
||||
foo = 1
|
||||
@@ -6,7 +6,7 @@ try:
|
||||
F().foo()
|
||||
except BaseException:
|
||||
print("BaseException")
|
||||
except <warning descr="'BaseException', superclass of exception class 'Exception', has already been caught">Exception</warning>:
|
||||
except <warning descr="'BaseException', superclass of the exception class 'Exception', has already been caught">Exception</warning>:
|
||||
print("Exception")
|
||||
|
||||
try:
|
||||
|
||||
@@ -9,7 +9,7 @@ class C1(B):
|
||||
|
||||
|
||||
class C2(B):
|
||||
def foo<warning descr="Signature of method 'C2.foo()' does not match signature of base method in class 'B'">(self)</warning>:
|
||||
def foo<warning descr="Signature of method 'C2.foo()' does not match signature of the base method in class 'B'">(self)</warning>:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -19,5 +19,5 @@ class B3:
|
||||
|
||||
|
||||
class C3(B3):
|
||||
def foo<warning descr="Signature of method 'C3.foo()' does not match signature of base method in class 'B3'">(self, arg1, arg2=None)</warning>: # fail
|
||||
def foo<warning descr="Signature of method 'C3.foo()' does not match signature of the base method in class 'B3'">(self, arg1, arg2=None)</warning>: # fail
|
||||
pass
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class MyType1(type):
|
||||
@classmethod
|
||||
def __prepare__<warning descr="Signature of method 'MyType1.__prepare__()' does not match signature of base method in class 'type'">(metacls, name)</warning>:
|
||||
def __prepare__<warning descr="Signature of method 'MyType1.__prepare__()' does not match signature of the base method in class 'type'">(metacls, name)</warning>:
|
||||
return {}
|
||||
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@ class C(B):
|
||||
def __new__(self, p, q): # different but ok because __new__ is special
|
||||
pass
|
||||
|
||||
def foo<warning descr="Signature of method 'C.foo()' does not match signature of base method in class 'B'">(self, s, t)</warning>:
|
||||
def foo<warning descr="Signature of method 'C.foo()' does not match signature of the base method in class 'B'">(self, s, t)</warning>:
|
||||
pass
|
||||
|
||||
@@ -4,10 +4,10 @@ class MyType1(type):
|
||||
|
||||
|
||||
class MyType2(type):
|
||||
def __instancecheck__<warning descr="Signature of method 'MyType2.__instancecheck__()' does not match signature of base method in class 'type'">(cls)</warning>:
|
||||
def __instancecheck__<warning descr="Signature of method 'MyType2.__instancecheck__()' does not match signature of the base method in class 'type'">(cls)</warning>:
|
||||
return True
|
||||
|
||||
|
||||
class MyType3(type):
|
||||
def __instancecheck__<warning descr="Signature of method 'MyType3.__instancecheck__()' does not match signature of base method in class 'type'">(cls, foo, bar)</warning>:
|
||||
def __instancecheck__<warning descr="Signature of method 'MyType3.__instancecheck__()' does not match signature of the base method in class 'type'">(cls, foo, bar)</warning>:
|
||||
return True
|
||||
|
||||
+1
-1
@@ -4,5 +4,5 @@ class B:
|
||||
|
||||
|
||||
class C(B):
|
||||
def foo<warning descr="Signature of method 'C.foo()' does not match signature of base method in class 'B'">(self, arg1=None)</warning>: #fail
|
||||
def foo<warning descr="Signature of method 'C.foo()' does not match signature of the base method in class 'B'">(self, arg1=None)</warning>: #fail
|
||||
pass
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ class A1:
|
||||
|
||||
|
||||
class B1(A1):
|
||||
def m<warning descr="Signature of method 'B1.m()' does not match signature of base method in class 'A1'">(self, p1, p2)</warning>:
|
||||
def m<warning descr="Signature of method 'B1.m()' does not match signature of the base method in class 'A1'">(self, p1, p2)</warning>:
|
||||
pass
|
||||
|
||||
|
||||
@@ -14,5 +14,5 @@ class A2:
|
||||
|
||||
|
||||
class B2(A2):
|
||||
def baz<warning descr="Signature of method 'B2.baz()' does not match signature of base method in class 'A2'">(self, a, /)</warning>:
|
||||
def baz<warning descr="Signature of method 'B2.baz()' does not match signature of the base method in class 'A2'">(self, a, /)</warning>:
|
||||
pass
|
||||
+1
-1
@@ -4,6 +4,6 @@ class B:
|
||||
|
||||
|
||||
class C(B):
|
||||
def foo<warning descr="Signature of method 'C.foo()' does not match signature of base method in class 'B'">(self, p1, **kwargs)</warning>: #fail
|
||||
def foo<warning descr="Signature of method 'C.foo()' does not match signature of the base method in class 'B'">(self, p1, **kwargs)</warning>: #fail
|
||||
pass
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
def <weak_warning descr="Type hinting is missing for function definition">foo</weak_warning>(x, y):
|
||||
def <weak_warning descr="Type hinting is missing for a function definition">foo</weak_warning>(x, y):
|
||||
pass
|
||||
@@ -1,4 +1,4 @@
|
||||
g = 2
|
||||
i = 2
|
||||
<warning descr="Non-ASCII character 'ɡ' in file, but no encoding declared">ɡ</warning> = 1
|
||||
<warning descr="Non-ASCII character 'ɡ' in the file, but no encoding declared">ɡ</warning> = 1
|
||||
a = g + i
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
import pip
|
||||
import <weak_warning descr="Package containing module 'opster' is not listed in project requirements">opster</weak_warning>
|
||||
from <weak_warning descr="Package containing module 'clevercss' is not listed in project requirements">clevercss</weak_warning> import convert
|
||||
import <weak_warning descr="Package containing module 'django' is not listed in project requirements">django</weak_warning>.conf
|
||||
import <weak_warning descr="Package containing module 'opster' is not listed in the project requirements">opster</weak_warning>
|
||||
from <weak_warning descr="Package containing module 'clevercss' is not listed in the project requirements">clevercss</weak_warning> import convert
|
||||
import <weak_warning descr="Package containing module 'django' is not listed in the project requirements">django</weak_warning>.conf
|
||||
import httplib
|
||||
import <weak_warning descr="Package containing module 'test3' is not listed in project requirements">test3</weak_warning>
|
||||
import <weak_warning descr="Package containing module 'test3' is not listed in the project requirements">test3</weak_warning>
|
||||
|
||||
print('Hello, World!')
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
from x import TEST as <weak_warning descr="Constant variable imported as non constant">test</weak_warning>
|
||||
from x import TEST as <weak_warning descr="Constant variable imported as non-constant">test</weak_warning>
|
||||
|
||||
@@ -1 +1 @@
|
||||
from x import y as <weak_warning descr="Lowercase variable imported as non lowercase">TEST</weak_warning>
|
||||
from x import y as <weak_warning descr="Lowercase variable imported as non-lowercase">TEST</weak_warning>
|
||||
|
||||
@@ -22,7 +22,7 @@ b = a.readonly
|
||||
|
||||
<warning descr="Property 'readonly' cannot be set">a.readonly</warning> += 1
|
||||
del <warning descr="Property 'readonly' cannot be deleted">a.readonly</warning>
|
||||
del <error descr="Can't delete function call">a.readonly()</error> # Error, delete the result of function
|
||||
del <error descr="Cannot delete function call">a.readonly()</error> # Error, delete the result of function
|
||||
|
||||
a.writeonly = 1
|
||||
<warning descr="Property 'writeonly' cannot be read">a.writeonly</warning> += 1
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"%()s" % {'': "name"} #ok
|
||||
<warning descr="Format specifier character missing">'test%(name)'</warning> % {'name': 23} #There are no format specifier character
|
||||
'work%*d' % (2, 34) #ok
|
||||
<warning descr="Can't use '*' in formats when using a mapping">'work%(name)*d'</warning> % (12, 32) #Can't use '*' in formats when using a mapping
|
||||
<warning descr="Cannot use '*' in formats when using a mapping">'work%(name)*d'</warning> % (12, 32) #Can't use '*' in formats when using a mapping
|
||||
'%*.*d' % (2, 5, 5) #ok
|
||||
'%*.*d' % (<warning descr="Too few arguments for format string">2, 4</warning>) #Too few arguments for format string
|
||||
'%*.*d' % (<warning descr="Too many arguments for format string">2, 4, 5, 6</warning>) #Too many arguments for format string
|
||||
@@ -15,7 +15,7 @@
|
||||
'%%%(name)ld' % {'name': 12} #ok
|
||||
"%(name)f(name)" % <warning descr="Format requires a mapping">23.2</warning> #Format requires a mapping
|
||||
"%(name)f(name)" % (<warning descr="Format requires a mapping">23.2</warning>) #Format requires a mapping
|
||||
'%d%d' % <warning descr="Format doesn't require a mapping">{'name1': 2, 'name2': 3}</warning> #Format doesn't require a mapping
|
||||
'%d%d' % <warning descr="Format does not require a mapping">{'name1': 2, 'name2': 3}</warning> #Format doesn't require a mapping
|
||||
'%12.2f' % 2.74 #ok
|
||||
'Hello world' % () #ok
|
||||
'Hello world' % [] #ok
|
||||
|
||||
+4
-4
@@ -39,17 +39,17 @@ def bar(*classes: Type[Proto]) -> None:
|
||||
pass
|
||||
|
||||
|
||||
foo(<warning descr="Only concrete class can be used where 'Type[Proto]' protocol is expected">Proto</warning>)
|
||||
foo(<warning descr="Only a concrete class can be used where 'Type[Proto]' protocol is expected">Proto</warning>)
|
||||
foo(Concrete1)
|
||||
foo(Concrete2)
|
||||
foo(<warning descr="Expected type 'Type[Proto]', got 'Type[Concrete3]' instead">Concrete3</warning>)
|
||||
foo(Concrete4) # matched as inheritor
|
||||
foo(<warning descr="Only concrete class can be used where 'Type[Proto]' protocol is expected">NewProto</warning>)
|
||||
foo(<warning descr="Only a concrete class can be used where 'Type[Proto]' protocol is expected">NewProto</warning>)
|
||||
|
||||
|
||||
bar(<warning descr="Only concrete class can be used where 'Type[Proto]' protocol is expected">Proto</warning>)
|
||||
bar(<warning descr="Only a concrete class can be used where 'Type[Proto]' protocol is expected">Proto</warning>)
|
||||
bar(Concrete1)
|
||||
bar(Concrete2)
|
||||
bar(<warning descr="Expected type 'Type[Proto]', got 'Type[Concrete3]' instead">Concrete3</warning>)
|
||||
bar(Concrete4) # matched as inheritor
|
||||
bar(<warning descr="Only concrete class can be used where 'Type[Proto]' protocol is expected">NewProto</warning>)
|
||||
bar(<warning descr="Only a concrete class can be used where 'Type[Proto]' protocol is expected">NewProto</warning>)
|
||||
|
||||
@@ -6,55 +6,55 @@ def foo(year, month, day, hour, minute, second):
|
||||
return 1
|
||||
|
||||
|
||||
if (True<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
or True<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
if (True<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
or True<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
or False):
|
||||
print("false")
|
||||
|
||||
var1 = (1,1,<warning descr="Unnecessary backslash in expression">\</warning>
|
||||
2,<warning descr="Unnecessary backslash in expression">\</warning>
|
||||
var1 = (1,1,<warning descr="Unnecessary backslash in the expression">\</warning>
|
||||
2,<warning descr="Unnecessary backslash in the expression">\</warning>
|
||||
3,
|
||||
4)
|
||||
|
||||
var2 = [1,2,<warning descr="Unnecessary backslash in expression">\</warning>
|
||||
3,<warning descr="Unnecessary backslash in expression">\</warning>
|
||||
var2 = [1,2,<warning descr="Unnecessary backslash in the expression">\</warning>
|
||||
3,<warning descr="Unnecessary backslash in the expression">\</warning>
|
||||
4]
|
||||
|
||||
var3 = {1, 2,<warning descr="Unnecessary backslash in expression">\</warning>
|
||||
var3 = {1, 2,<warning descr="Unnecessary backslash in the expression">\</warning>
|
||||
3,4}
|
||||
|
||||
var4 = {1:1, 2:2,<warning descr="Unnecessary backslash in expression">\</warning>
|
||||
var4 = {1:1, 2:2,<warning descr="Unnecessary backslash in the expression">\</warning>
|
||||
3:3,
|
||||
4:4}
|
||||
|
||||
|
||||
assert (val>4,<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
assert (val>4,<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
"val is too small")
|
||||
|
||||
var5 = (val1 < 20) and \
|
||||
(val2 < 30) and \
|
||||
(val3 < 40)
|
||||
|
||||
var6 = ('1' + '2' + '3' +<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
var6 = ('1' + '2' + '3' +<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
'4' + '5')
|
||||
|
||||
|
||||
def foo(a, b,<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
def foo(a, b,<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
c):
|
||||
pass
|
||||
|
||||
foo(1, 2,<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
foo(1, 2,<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
3)
|
||||
|
||||
# PY-3036
|
||||
v = [ "some"<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
v = [ "some"<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
"long string" ]
|
||||
|
||||
a = func('some '<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
a = func('some '<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
'string')
|
||||
|
||||
|
||||
#PY-6589
|
||||
a = (<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
(1,<warning descr="Unnecessary backslash in expression"> \</warning>
|
||||
a = (<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
(1,<warning descr="Unnecessary backslash in the expression"> \</warning>
|
||||
2),2)
|
||||
+2
-2
@@ -12,7 +12,7 @@ def f(x):
|
||||
|
||||
def f(x):
|
||||
try:
|
||||
from foo import <warning descr="'StringIO' in try block with 'except ImportError' should also be defined in except block">StringIO</warning>
|
||||
from foo import <warning descr="'StringIO' in the try block with 'except ImportError' should also be defined in the except block">StringIO</warning>
|
||||
except ImportError:
|
||||
pass
|
||||
return StringIO(x)
|
||||
@@ -82,7 +82,7 @@ except ImportError:
|
||||
|
||||
# PY-8933: Import referenced by inner scope should be reported
|
||||
try:
|
||||
from foo import <warning descr="'UsedInsideFunction' in try block with 'except ImportError' should also be defined in except block">UsedInsideFunction</warning>
|
||||
from foo import <warning descr="'UsedInsideFunction' in the try block with 'except ImportError' should also be defined in the except block">UsedInsideFunction</warning>
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ class C:
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
<warning descr="Decorator @classmethod on method outside class"><caret>@classmethod</warning>
|
||||
<warning descr="Decorator @classmethod on a method outside the class"><caret>@classmethod</warning>
|
||||
def foo(self):
|
||||
print ("Constructor C was called")
|
||||
@@ -1 +1 @@
|
||||
<warning descr="Statement seems to have no effect and can be replaced with function call to have effect">exec</warning><error descr="End of statement expected"> </error><warning descr="Statement seems to have no effect">1</warning> # <- doesn't work either
|
||||
<warning descr="Statement seems to have no effect and can be replaced with a function call to have effect">exec</warning><error descr="End of statement expected"> </error><warning descr="Statement seems to have no effect">1</warning> # <- doesn't work either
|
||||
@@ -1 +1 @@
|
||||
<warning descr="Statement seems to have no effect and can be replaced with function call to have effect">print</warning><error descr="End of statement expected"> </error><warning descr="Statement seems to have no effect">'%s %s %s %s' % bar</warning> # <- doesn't work either
|
||||
<warning descr="Statement seems to have no effect and can be replaced with a function call to have effect">print</warning><error descr="End of statement expected"> </error><warning descr="Statement seems to have no effect">'%s %s %s %s' % bar</warning> # <- doesn't work either
|
||||
@@ -1 +1 @@
|
||||
<warning descr="Statement seems to have no effect and can be replaced with function call to have effect">print</warning><error descr="End of statement expected"> </error><warning descr="Statement seems to have no effect">var,</warning>
|
||||
<warning descr="Statement seems to have no effect and can be replaced with a function call to have effect">print</warning><error descr="End of statement expected"> </error><warning descr="Statement seems to have no effect">var,</warning>
|
||||
@@ -3,4 +3,4 @@ class klass:
|
||||
pass
|
||||
|
||||
var = klass()
|
||||
<warning descr="Statement seems to have no effect and can be replaced with function call to have effect">var.f<caret>oo</warning>
|
||||
<warning descr="Statement seems to have no effect and can be replaced with a function call to have effect">var.f<caret>oo</warning>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var1 = (1,1,<warning descr="Unnecessary backslash in expression"><caret>\</warning>
|
||||
2,<warning descr="Unnecessary backslash in expression">\</warning>
|
||||
var1 = (1,1,<warning descr="Unnecessary backslash in the expression"><caret>\</warning>
|
||||
2,<warning descr="Unnecessary backslash in the expression">\</warning>
|
||||
3,
|
||||
4)
|
||||
@@ -1,4 +1,4 @@
|
||||
def foo(a, b,<warning descr="Unnecessary backslash in expression"><caret>\</warning>
|
||||
c,<warning descr="Unnecessary backslash in expression">\</warning>
|
||||
def foo(a, b,<warning descr="Unnecessary backslash in the expression"><caret>\</warning>
|
||||
c,<warning descr="Unnecessary backslash in the expression">\</warning>
|
||||
d):
|
||||
pass
|
||||
@@ -35,7 +35,7 @@ PyFile:Await.py
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyAssignmentStatement
|
||||
PsiErrorElement:Can't assign to await expression
|
||||
PsiErrorElement:Cannot assign to await expression
|
||||
PsiElement(Py:AWAIT_KEYWORD)('await')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: x
|
||||
|
||||
@@ -9,5 +9,5 @@ except NameError:
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
except <warning descr="'NameError', superclass of exception class 'UnboundLocalError', has already been caught">UnboundLocalE<caret>rror</warning>:
|
||||
except <warning descr="'NameError', superclass of the exception class 'UnboundLocalError', has already been caught">UnboundLocalE<caret>rror</warning>:
|
||||
pass
|
||||
@@ -6,5 +6,5 @@ try:
|
||||
foo()
|
||||
except NameError:
|
||||
pass
|
||||
except <warning descr="'NameError', superclass of exception class 'UnboundLocalError', has already been caught">Unbo<caret>undLocalError</warning>:
|
||||
except <warning descr="'NameError', superclass of the exception class 'UnboundLocalError', has already been caught">Unbo<caret>undLocalError</warning>:
|
||||
pass
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
def <warning descr="Type(s) specified both in type comment and annotation">b<caret>ar</warning>(a: int) -> int:
|
||||
<warning descr="Type(s) specified both in type comment and annotation"># type: (int) -> int</warning>
|
||||
def <warning descr="Types specified both in a type comment and annotation">b<caret>ar</warning>(a: int) -> int:
|
||||
<warning descr="Types specified both in a type comment and annotation"># type: (int) -> int</warning>
|
||||
pass
|
||||
@@ -352,7 +352,7 @@ public class PyQuickFixTest extends PyTestCase {
|
||||
|
||||
// PY-1265
|
||||
public void testStatementEffectIntroduceVariable() {
|
||||
doInspectionTest(PyStatementEffectInspection.class, PyBundle.message("QFIX.statement.effect.introduce.variable"), true, true);
|
||||
doInspectionTest(PyStatementEffectInspection.class, PyPsiBundle.message("QFIX.introduce.variable"), true, true);
|
||||
}
|
||||
|
||||
// PY-2092
|
||||
@@ -688,33 +688,33 @@ public class PyQuickFixTest extends PyTestCase {
|
||||
|
||||
// PY-8174
|
||||
public void testChangeSignatureKeywordAndPositionalParameters() {
|
||||
doInspectionTest(PyArgumentListInspection.class, "<html>Change signature of f(x, foo, <b>bar</b>)</html>", true, true);
|
||||
doInspectionTest(PyArgumentListInspection.class, "<html>Change the signature of f(x, foo, <b>bar</b>)</html>", true, true);
|
||||
}
|
||||
|
||||
// PY-8174
|
||||
public void testChangeSignatureAddKeywordOnlyParameter() {
|
||||
runWithLanguageLevel(
|
||||
LanguageLevel.PYTHON34,
|
||||
() -> doInspectionTest(PyArgumentListInspection.class, "<html>Change signature of func(x, *args, foo, <b>bar</b>)</html>", true, true)
|
||||
() -> doInspectionTest(PyArgumentListInspection.class, "<html>Change the signature of func(x, *args, foo, <b>bar</b>)</html>", true, true)
|
||||
);
|
||||
}
|
||||
|
||||
// PY-8174
|
||||
public void testChangeSignatureNewParametersNames() {
|
||||
doInspectionTest(PyArgumentListInspection.class, "<html>Change signature of func(i1, <b>i</b>, <b>i3</b>, <b>num</b>)</html>", true, true);
|
||||
doInspectionTest(PyArgumentListInspection.class, "<html>Change the signature of func(i1, <b>i</b>, <b>i3</b>, <b>num</b>)</html>", true, true);
|
||||
}
|
||||
|
||||
// PY-8174
|
||||
public void testChangeSignatureParametersDefaultValues() {
|
||||
doInspectionTest(PyArgumentListInspection.class, "<html>Change signature of func(<b>i</b>, <b>foo</b>)</html>", true, true);
|
||||
doInspectionTest(PyArgumentListInspection.class, "<html>Change the signature of func(<b>i</b>, <b>foo</b>)</html>", true, true);
|
||||
}
|
||||
|
||||
public void testAddKwargsToNewMethodIncompatibleWithInit() {
|
||||
doInspectionTest(PyInitNewSignatureInspection.class, "<html>Change signature of __new__(cls, <b>**kwargs</b>)</html>", true, true);
|
||||
doInspectionTest(PyInitNewSignatureInspection.class, "<html>Change the signature of __new__(cls, <b>**kwargs</b>)</html>", true, true);
|
||||
}
|
||||
|
||||
public void testAddKwargsToIncompatibleOverridingMethod() {
|
||||
doInspectionTest(PyMethodOverridingInspection.class, "<html>Change signature of m(self, <b>**kwargs</b>)</html>", true, true);
|
||||
doInspectionTest(PyMethodOverridingInspection.class, "<html>Change the signature of m(self, <b>**kwargs</b>)</html>", true, true);
|
||||
}
|
||||
|
||||
// PY-30789
|
||||
|
||||
@@ -61,7 +61,7 @@ public class PySuppressInspectionsTest extends PyTestCase {
|
||||
public void testSuppressForStatement() {
|
||||
myFixture.configureByFile("inspections/suppress/suppressForStatement.py");
|
||||
myFixture.enableInspections(PyUnresolvedReferencesInspection.class);
|
||||
final List<IntentionAction> intentions = myFixture.filterAvailableIntentions("Suppress for statement");
|
||||
final List<IntentionAction> intentions = myFixture.filterAvailableIntentions("Suppress for a statement");
|
||||
assertEquals(3, intentions.size()); // Rename reference, Ignore unresolved reference, Mark all unresolved attributes
|
||||
final IntentionAction suppressAction = intentions.get(0);
|
||||
myFixture.launchAction(suppressAction);
|
||||
|
||||
@@ -609,11 +609,11 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
|
||||
LanguageLevel.PYTHON35,
|
||||
() -> doTestByText("from typing_extensions import Final\n" +
|
||||
"\n" +
|
||||
"def foo1() <warning descr=\"'Final' could not be used in annotation for function return value\">-> Final[int]</warning>:\n" +
|
||||
"def foo1() <warning descr=\"'Final' could not be used in annotation for a function return value\">-> Final[int]</warning>:\n" +
|
||||
" pass\n" +
|
||||
"\n" +
|
||||
"def foo2():\n" +
|
||||
" <warning descr=\"'Final' could not be used in annotation for function return value\"># type: () -> Final[int]</warning>\n" +
|
||||
" <warning descr=\"'Final' could not be used in annotation for a function return value\"># type: () -> Final[int]</warning>\n" +
|
||||
" pass")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -689,22 +689,22 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
|
||||
runWithLanguageLevel(
|
||||
LanguageLevel.PYTHON36,
|
||||
() -> doTestByText(
|
||||
"a<warning descr=\"Type(s) specified both in type comment and annotation\">: int</warning> = None <warning descr=\"Type(s) specified both in type comment and annotation\"># type: int</warning>\n" +
|
||||
"a<warning descr=\"Types specified both in a type comment and annotation\">: int</warning> = None <warning descr=\"Types specified both in a type comment and annotation\"># type: int</warning>\n" +
|
||||
"\n" +
|
||||
"def foo(a<warning descr=\"Type(s) specified both in type comment and annotation\">: int</warning> <warning descr=\"Type(s) specified both in type comment and annotation\"># type: int</warning>\n" +
|
||||
"def foo(a<warning descr=\"Types specified both in a type comment and annotation\">: int</warning> <warning descr=\"Types specified both in a type comment and annotation\"># type: int</warning>\n" +
|
||||
" ,):\n" +
|
||||
" pass\n" +
|
||||
"\n" +
|
||||
"def <warning descr=\"Type(s) specified both in type comment and annotation\">bar</warning>(a: int) -> int:\n" +
|
||||
" <warning descr=\"Type(s) specified both in type comment and annotation\"># type: (int) -> int</warning>\n" +
|
||||
"def <warning descr=\"Types specified both in a type comment and annotation\">bar</warning>(a: int) -> int:\n" +
|
||||
" <warning descr=\"Types specified both in a type comment and annotation\"># type: (int) -> int</warning>\n" +
|
||||
" pass\n" +
|
||||
" \n" +
|
||||
"def <warning descr=\"Type(s) specified both in type comment and annotation\">baz1</warning>(a: int):\n" +
|
||||
" <warning descr=\"Type(s) specified both in type comment and annotation\"># type: (int) -> int</warning>\n" +
|
||||
"def <warning descr=\"Types specified both in a type comment and annotation\">baz1</warning>(a: int):\n" +
|
||||
" <warning descr=\"Types specified both in a type comment and annotation\"># type: (int) -> int</warning>\n" +
|
||||
" pass\n" +
|
||||
" \n" +
|
||||
"def <warning descr=\"Type(s) specified both in type comment and annotation\">baz2</warning>(a) -> int:\n" +
|
||||
" <warning descr=\"Type(s) specified both in type comment and annotation\"># type: (int) -> int</warning>\n" +
|
||||
"def <warning descr=\"Types specified both in a type comment and annotation\">baz2</warning>(a) -> int:\n" +
|
||||
" <warning descr=\"Types specified both in a type comment and annotation\"># type: (int) -> int</warning>\n" +
|
||||
" pass"
|
||||
)
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class PyTypedDictInspectionTest extends PyInspectionTestCase {
|
||||
() -> doTestByText("from typing import TypedDict\n" +
|
||||
"class Movie(TypedDict):\n" +
|
||||
" name: str\n" +
|
||||
" year: int = <warning descr=\"Right hand side values are not supported in TypedDict\">42</warning>"));
|
||||
" year: int = <warning descr=\"Right-hand side values are not supported in TypedDict\">42</warning>"));
|
||||
}
|
||||
|
||||
public void testPass() {
|
||||
|
||||
+3
-1
@@ -8,6 +8,7 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.xdebugger.impl.XSourcePositionImpl;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.debugger.PyDebuggerEditorsProvider;
|
||||
import com.jetbrains.python.fixtures.PyInspectionTestCase;
|
||||
import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
|
||||
@@ -396,7 +397,8 @@ public class PyUnresolvedReferencesInspectionTest extends PyInspectionTestCase {
|
||||
myFixture.configureByFile("inspections/" + inspectionName + "/" + testName + ".py");
|
||||
myFixture.enableInspections(getInspectionClass());
|
||||
final String attrQualifiedName = "inspections." + inspectionName + "." + testName + ".A.foo";
|
||||
final IntentionAction intentionAction = myFixture.findSingleIntention("Ignore unresolved reference '" + attrQualifiedName + "'");
|
||||
String quickFixName = PyBundle.message("QFIX.ignore.unresolved.reference.0", attrQualifiedName);
|
||||
final IntentionAction intentionAction = myFixture.findSingleIntention(quickFixName);
|
||||
assertNotNull(intentionAction);
|
||||
myFixture.launchAction(intentionAction);
|
||||
myFixture.checkHighlighting(isWarning(), isInfo(), isWeakWarning());
|
||||
|
||||
@@ -39,17 +39,17 @@ class PyTypeHintsQuickFixTest : PyQuickFixTestCase() {
|
||||
|
||||
// PY-28243
|
||||
fun testTypeVarAndTargetName() {
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Replace with target name")
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Replace with the target name")
|
||||
}
|
||||
|
||||
// PY-28249
|
||||
fun testInstanceCheckOnCallable() {
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Remove generic parameter(s)")
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Remove generic parameters")
|
||||
}
|
||||
|
||||
// PY-28249
|
||||
fun testInstanceCheckOnCustom() {
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Remove generic parameter(s)")
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Remove generic parameters")
|
||||
}
|
||||
|
||||
// PY-28249
|
||||
@@ -58,12 +58,12 @@ class PyTypeHintsQuickFixTest : PyQuickFixTestCase() {
|
||||
myFixture.configureByFile("${getTestName(true)}.py")
|
||||
myFixture.checkHighlighting(true, false, false)
|
||||
|
||||
assertEmpty(myFixture.filterAvailableIntentions("Remove generic parameter(s)"))
|
||||
assertEmpty(myFixture.filterAvailableIntentions("Remove generic parameters"))
|
||||
}
|
||||
|
||||
// PY-28249
|
||||
fun testInstanceCheckOnOperandReference() {
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Remove generic parameter(s)")
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Remove generic parameters")
|
||||
}
|
||||
|
||||
// PY-20530
|
||||
@@ -88,12 +88,12 @@ class PyTypeHintsQuickFixTest : PyQuickFixTestCase() {
|
||||
|
||||
// PY-20530
|
||||
fun testSelfInAnnotation() {
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Replace with type name", LanguageLevel.PYTHON37)
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Replace with the type name", LanguageLevel.PYTHON37)
|
||||
}
|
||||
|
||||
// PY-20530
|
||||
fun testSelfInTypeComment() {
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Replace with type name")
|
||||
doQuickFixTest(PyTypeHintsInspection::class.java, "Replace with the type name")
|
||||
}
|
||||
|
||||
// PY-20530
|
||||
|
||||
@@ -79,11 +79,11 @@ public class PyExtractMethodTest extends LightMarkedTestCase {
|
||||
}
|
||||
|
||||
public void testNameCollisionFile() {
|
||||
doFail("hello", "Method name clashes with already existing name");
|
||||
doFail("hello", "The method name clashes with an already existing name");
|
||||
}
|
||||
|
||||
public void testNameCollisionSuperClass() {
|
||||
doFail("hello", "Method name clashes with already existing name");
|
||||
doFail("hello", "The method name clashes with an already existing name");
|
||||
}
|
||||
|
||||
public void testOutNotEmptyStatements() {
|
||||
@@ -111,11 +111,11 @@ public class PyExtractMethodTest extends LightMarkedTestCase {
|
||||
}
|
||||
|
||||
public void testWrongSelectionIfPart() {
|
||||
doFail("bar", "Cannot perform extract method using selected element(s)");
|
||||
doFail("bar", "Cannot perform extract method using the selected element(s)");
|
||||
}
|
||||
|
||||
public void testWrongSelectionFromImportStar() {
|
||||
doFail("bar", "Cannot perform refactoring with star import statement inside code block");
|
||||
doFail("bar", "Cannot perform refactoring with a star import statement inside a code block");
|
||||
}
|
||||
|
||||
public void testPy479() {
|
||||
@@ -213,7 +213,7 @@ public class PyExtractMethodTest extends LightMarkedTestCase {
|
||||
|
||||
// PY-7381
|
||||
public void testYield() {
|
||||
doFail("bar", "Cannot perform refactoring with 'yield' statement inside code block");
|
||||
doFail("bar", "Cannot perform refactoring with a 'yield' statement inside a code block");
|
||||
}
|
||||
|
||||
// PY-7382
|
||||
@@ -253,7 +253,7 @@ public class PyExtractMethodTest extends LightMarkedTestCase {
|
||||
|
||||
// PY-6620
|
||||
public void testProhibitedAtClassLevel() {
|
||||
doFail("foo", "Cannot perform refactoring at class level");
|
||||
doFail("foo", "Cannot perform refactoring at a class level");
|
||||
}
|
||||
|
||||
public void testAsyncDef() {
|
||||
|
||||
@@ -124,10 +124,10 @@ class PyInlineFunctionTest : PyTestCase() {
|
||||
fun testInterruptedFlow() = doTestError("Cannot inline functions that interrupt control flow")
|
||||
fun testFunctionFromBinaryStub() {
|
||||
runWithAdditionalFileInSkeletonDir("sys.py", "def exit():\n pass") {
|
||||
doTestError("Cannot inline function from binary module")
|
||||
doTestError("Cannot inline a function from the binary module")
|
||||
}
|
||||
}
|
||||
fun testUsedAsDecorator() = doTestError("Function foo is used as a decorator and cannot be inlined. Function definition will not be removed", isReferenceError = true)
|
||||
fun testUsedAsReference() = doTestError("Function foo is used as a reference and cannot be inlined. Function definition will not be removed", isReferenceError = true)
|
||||
fun testUsesArgumentUnpacking() = doTestError("Function foo uses argument unpacking and cannot be inlined. Function definition will not be removed", isReferenceError = true)
|
||||
fun testUsedAsDecorator() = doTestError("The function foo is used as a decorator and cannot be inlined. The function definition will not be removed", isReferenceError = true)
|
||||
fun testUsedAsReference() = doTestError("The function foo is used as a reference and cannot be inlined. The function definition will not be removed", isReferenceError = true)
|
||||
fun testUsesArgumentUnpacking() = doTestError("The function foo uses argument unpacking and cannot be inlined. The function definition will not be removed", isReferenceError = true)
|
||||
}
|
||||
@@ -270,7 +270,7 @@ public class PyIntroduceVariableTest extends PyIntroduceTestCase {
|
||||
doTest();
|
||||
}
|
||||
catch (CommonRefactoringUtil.RefactoringErrorHintException e) {
|
||||
if (e.getMessage().equals("Cannot perform refactoring using selected element(s)")) {
|
||||
if (e.getMessage().equals("Cannot perform refactoring using the selected element(s)")) {
|
||||
thrownExpectedException = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ public class PyMoveTest extends PyTestCase {
|
||||
fail();
|
||||
}
|
||||
catch (IncorrectOperationException e) {
|
||||
assertEquals("Cannot use module name 'dst-unimportable.py' in imports", e.getMessage());
|
||||
assertEquals("Cannot use a module name 'dst-unimportable.py' in imports", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user