Inspect protocol subclass types (PY-26628)

This commit is contained in:
Semyon Proshev
2018-02-05 20:58:30 +03:00
parent 6fa83614d4
commit 68a7b6040e
12 changed files with 294 additions and 62 deletions
@@ -0,0 +1,38 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.inspections;
import com.intellij.testFramework.LightProjectDescriptor;
import com.jetbrains.python.fixtures.PyInspectionTestCase;
import com.jetbrains.python.psi.LanguageLevel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class PyProtocolInspectionTest extends PyInspectionTestCase {
// PY-26628
public void testValidProtocolSubclass() {
doTest();
}
// PY-26628
public void testIncompatibleProtocolSubclass() {
doTest();
}
@Override
protected void doTest() {
runWithLanguageLevel(LanguageLevel.PYTHON37, () -> super.doTest());
}
@Nullable
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return ourPy3Descriptor;
}
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {
return PyProtocolInspection.class;
}
}