mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
added tests for PY-3373
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
""" test docstring inspection"""
|
||||
def foo1(a, b):
|
||||
"""
|
||||
|
||||
@param a:
|
||||
@param b:
|
||||
@return:
|
||||
"""
|
||||
pass
|
||||
|
||||
def foo(a, b, n):
|
||||
<warning descr="Missing parameters b, n in docstring.">"""
|
||||
|
||||
@param a:
|
||||
@return:
|
||||
"""</warning>
|
||||
pass
|
||||
|
||||
def foo():
|
||||
<warning descr="Unexpected parameters in docstring">"""
|
||||
|
||||
@param a:
|
||||
@return:
|
||||
"""</warning>
|
||||
pass
|
||||
|
||||
|
||||
def foo(a, c):
|
||||
<warning descr="Missing parameters c in docstring.">"""
|
||||
@param a:
|
||||
@param b:
|
||||
@return:
|
||||
"""</warning>
|
||||
pass
|
||||
@@ -2,6 +2,8 @@ package com.jetbrains.python;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
|
||||
import com.jetbrains.python.documentation.DocStringFormat;
|
||||
import com.jetbrains.python.documentation.PyDocumentationSettings;
|
||||
import com.jetbrains.python.fixtures.PyLightFixtureTestCase;
|
||||
import com.jetbrains.python.inspections.*;
|
||||
import com.jetbrains.python.psi.LanguageLevel;
|
||||
@@ -173,6 +175,17 @@ public class PythonInspectionsTest extends PyLightFixtureTestCase {
|
||||
doTest(getTestName(false), inspection);
|
||||
}
|
||||
|
||||
public void testPyDocstringParametersInspection() { //PY-3373
|
||||
PyDocumentationSettings documentationSettings = PyDocumentationSettings.getInstance(myFixture.getProject());
|
||||
documentationSettings.setFormat(DocStringFormat.EPYTEXT);
|
||||
try {
|
||||
doHighlightingTest(PyDocstringInspection.class);
|
||||
}
|
||||
finally {
|
||||
documentationSettings.setFormat(DocStringFormat.PLAIN);
|
||||
}
|
||||
}
|
||||
|
||||
public void testPyStatementEffectInspection() {
|
||||
doHighlightingTest(PyStatementEffectInspection.class, LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user