Due to non-deterministic order of test execution (in particular if
CythonParsingTest has been executed before PyOptimizeImportsTest)
sometimes PyDocstringTokenSetContributor was registered via EP,
but wan't taken into account in the cached static instance of
PythonDialectTokenSetProvider.
Since reference expressions inside injected fragments have element
type DOC_REFERENCE and the latter wasn't part of expression token set,
that assertion in PySubscriptionExpression#getOperand failed.
* @author yole
*/
public class PyOptimizeImportsTest extends PyTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ // importsFromTypingUnusedInTypeComments depends on registered TokenSetContributors
+ PythonDialectsTokenSetProvider.reset();
+ }
+
public void testSimple() {
doTest();
}