mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Tests on add global quickfix added
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
a = 1
|
||||
|
||||
def foo():
|
||||
global b
|
||||
print <caret><warning descr="Local variable 'a' referenced before assignment">a</warning>
|
||||
a = 2
|
||||
print a
|
||||
|
||||
foo()
|
||||
@@ -0,0 +1,9 @@
|
||||
a = 1
|
||||
|
||||
def foo():
|
||||
global b, a
|
||||
print a
|
||||
a = 2
|
||||
print a
|
||||
|
||||
foo()
|
||||
@@ -0,0 +1,8 @@
|
||||
a = 1
|
||||
|
||||
def foo():
|
||||
print <caret><warning descr="Local variable 'a' referenced before assignment">a</warning>
|
||||
a = 2
|
||||
print a
|
||||
|
||||
foo()
|
||||
@@ -0,0 +1,9 @@
|
||||
a = 1
|
||||
|
||||
def foo():
|
||||
global a
|
||||
print a
|
||||
a = 2
|
||||
print a
|
||||
|
||||
foo()
|
||||
@@ -97,6 +97,16 @@ public class PyQuickFixTest extends PyLightFixtureTestCase {
|
||||
PyBundle.message("QFIX.classic.class.transform"), true, true);
|
||||
}
|
||||
|
||||
public void testAddGlobalQuickFix() throws Exception {
|
||||
doInspectionTest("AddGlobalStatement.py", PyUnboundLocalVariableInspection.class,
|
||||
PyBundle.message("QFIX.add.global"), true, true);
|
||||
}
|
||||
|
||||
public void testAddGlobalExistingQuickFix() throws Exception {
|
||||
doInspectionTest("AddGlobalExistingStatement.py", PyUnboundLocalVariableInspection.class,
|
||||
PyBundle.message("QFIX.add.global"), true, true);
|
||||
}
|
||||
|
||||
protected void doInspectionTest(@NonNls String testFileName,
|
||||
final Class inspectionClass,
|
||||
@NonNls String quickFixName,
|
||||
|
||||
Reference in New Issue
Block a user