Reset token set provider in tests where contributors are registered manually

It should also fix constant blinking of the test
PyFunctionTypeAnnotationParsingTest.testNoReturnType.
This commit is contained in:
Mikhail Golubev
2017-06-14 21:05:51 +03:00
parent f879f24c0b
commit 797998c49c
4 changed files with 5 additions and 3 deletions
@@ -42,6 +42,7 @@ public class PyFunctionTypeAnnotationParsingTest extends ParsingTestCase {
registerExtensionPoint(PythonDialectsTokenSetContributor.EP_NAME, PythonDialectsTokenSetContributor.class);
registerExtension(PythonDialectsTokenSetContributor.EP_NAME, new PythonTokenSetContributor());
registerExtension(PythonDialectsTokenSetContributor.EP_NAME, new PyDocstringTokenSetContributor());
PythonDialectsTokenSetProvider.reset();
}
protected void doCodeTest(@NotNull String typeAnnotation) {
@@ -40,6 +40,7 @@ public class PythonConsoleParsingTest extends ParsingTestCase {
protected void setUp() throws Exception {
super.setUp();
registerExtension(PythonDialectsTokenSetContributor.EP_NAME, new PythonTokenSetContributor());
PythonDialectsTokenSetProvider.reset();
}
@Override
@@ -41,6 +41,7 @@ public class PythonParsingTest extends ParsingTestCase {
super.setUp();
registerExtensionPoint(PythonDialectsTokenSetContributor.EP_NAME, PythonDialectsTokenSetContributor.class);
registerExtension(PythonDialectsTokenSetContributor.EP_NAME, new PythonTokenSetContributor());
PythonDialectsTokenSetProvider.reset();
}
@Override
@@ -17,9 +17,7 @@ package com.jetbrains.python.pyi;
import com.intellij.testFramework.ParsingTestCase;
import com.intellij.testFramework.TestDataPath;
import com.jetbrains.python.PythonDialectsTokenSetContributor;
import com.jetbrains.python.PythonTestUtil;
import com.jetbrains.python.PythonTokenSetContributor;
import com.jetbrains.python.*;
import com.jetbrains.python.psi.LanguageLevel;
/**
@@ -36,6 +34,7 @@ public class PyiParsingTest extends ParsingTestCase {
super.setUp();
registerExtensionPoint(PythonDialectsTokenSetContributor.EP_NAME, PythonDialectsTokenSetContributor.class);
registerExtension(PythonDialectsTokenSetContributor.EP_NAME, new PythonTokenSetContributor());
PythonDialectsTokenSetProvider.reset();
}
@Override