mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Look for unbound class level variable on file level, not in parent scope (PY-19890)
This commit is contained in:
@@ -1286,4 +1286,13 @@ public class PyResolveTest extends PyResolveTestCase {
|
||||
() -> assertResolvesTo(PyClass.class, "A")
|
||||
);
|
||||
}
|
||||
|
||||
// PY-19890
|
||||
public void testUnboundVariableOnClassLevel() {
|
||||
final PyTargetExpression foo = assertResolvesTo(PyTargetExpression.class, "foo");
|
||||
|
||||
final PyExpression value = foo.findAssignedValue();
|
||||
assertInstanceOf(value, PyStringLiteralExpression.class);
|
||||
assertEquals("global", ((PyStringLiteralExpression)value).getStringValue());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user