mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Update PyPropertyAccessInspectionTest to run tests with both Pythons
This commit is contained in:
+38
-1
@@ -15,9 +15,14 @@
|
||||
*/
|
||||
package com.jetbrains.python.inspections;
|
||||
|
||||
import com.intellij.openapi.application.WriteAction;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.jetbrains.python.fixtures.PyTestCase;
|
||||
import com.jetbrains.python.psi.LanguageLevel;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
@@ -34,11 +39,13 @@ public class PyPropertyAccessInspectionTest extends PyTestCase {
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndSlotsWithDict() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
@@ -54,41 +61,49 @@ public class PyPropertyAccessInspectionTest extends PyTestCase {
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndInheritedSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndInheritedSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndOwnSlotsAndEmptyParent() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndOwnAndInheritedSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndOwnWithDictAndInheritedSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndOwnWithDictAndInheritedWithAttrSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndOwnAndInheritedWithDictSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
@@ -104,31 +119,37 @@ public class PyPropertyAccessInspectionTest extends PyTestCase {
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndOwnAndInheritedWithAttrSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testClassAttrAssignmentAndOwnAndInheritedWithAttrAndDictSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnAndInheritedSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnWithAttrAndInheritedSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnWithDictAndInheritedSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnWithAttrAndDictAndInheritedSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
@@ -144,21 +165,25 @@ public class PyPropertyAccessInspectionTest extends PyTestCase {
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnAndInheritedWithDictSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnAndInheritedWithAttrAndDictSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnWithAttrAndInheritedWithDictSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
// PY-12773
|
||||
public void testInheritedClassAttrAssignmentAndOwnWithDictAndInheritedWithAttrSlots() {
|
||||
doTestPy2();
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
private void doTestPy2() {
|
||||
@@ -170,7 +195,19 @@ public class PyPropertyAccessInspectionTest extends PyTestCase {
|
||||
}
|
||||
|
||||
private void doTestPy() {
|
||||
myFixture.configureByFile("inspections/PyPropertyAccessInspection/" + getTestName(true) + ".py");
|
||||
final String path = "inspections/PyPropertyAccessInspection/" + getTestName(true) + ".py";
|
||||
|
||||
final VirtualFile file = myFixture.getTempDirFixture().getFile(path);
|
||||
if (file != null) {
|
||||
try {
|
||||
WriteAction.run(() -> file.delete(this));
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
myFixture.configureByFile(path);
|
||||
myFixture.enableInspections(PyPropertyAccessInspection.class);
|
||||
myFixture.checkHighlighting(true, false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user