PY-47974 Fixed missing components for running PythonConsoleParsingTest

GitOrigin-RevId: 7391ba5f43c770ebbc1cbbcde8b72387c5c90ea7
This commit is contained in:
Andrey Vlasovskikh
2021-04-08 03:14:23 +03:00
committed by intellij-monorepo-bot
parent 56c8ba0430
commit dfbab3186a
8 changed files with 14 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
PyFile:Console.py
PyExpressionStatement
PyStringLiteralExpression:
PyStringLiteralExpression: foo
PsiElement(Py:SINGLE_QUOTED_STRING)('b"foo"')

View File

@@ -1,4 +1,4 @@
PyFile:Console.py
PyExpressionStatement
PyStringLiteralExpression:
PyStringLiteralExpression: foo
PsiElement(Py:TRIPLE_QUOTED_STRING)('b"""foo"""')

View File

@@ -1,4 +1,4 @@
PyFile:Console.py
PyExpressionStatement
PyStringLiteralExpression:
PyStringLiteralExpression: foo
PsiElement(Py:SINGLE_QUOTED_STRING)('"foo"')

View File

@@ -1,5 +1,5 @@
PyFile:Console.py
PyExpressionStatement
PyStringLiteralExpression:
PyStringLiteralExpression: foo
PsiElement(Py:SINGLE_QUOTED_STRING)('"foo"')
PsiWhiteSpace('\n')

View File

@@ -1,5 +1,5 @@
PyFile:Console.py
PsiWhiteSpace('\n')
PyExpressionStatement
PyStringLiteralExpression:
PyStringLiteralExpression: foo
PsiElement(Py:SINGLE_QUOTED_STRING)('"foo"')

View File

@@ -1,4 +1,4 @@
PyFile:Console.py
PyExpressionStatement
PyStringLiteralExpression:
PyStringLiteralExpression: foo
PsiElement(Py:TRIPLE_QUOTED_STRING)('"""foo"""')

View File

@@ -1,5 +1,5 @@
PyFile:Console.py
PyExpressionStatement
PyStringLiteralExpression:
PyStringLiteralExpression: foo
PsiElement(Py:SINGLE_QUOTED_STRING)('"foo"')
PsiWhiteSpace(' ')

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2020 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.console;
import com.intellij.lang.LanguageASTFactory;
import com.intellij.mock.MockApplication;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
@@ -12,6 +13,9 @@ import com.intellij.testFramework.ParsingTestCase;
import com.intellij.testFramework.TestDataPath;
import com.jetbrains.python.*;
import com.jetbrains.python.psi.LanguageLevel;
import com.jetbrains.python.psi.PyPsiFacade;
import com.jetbrains.python.psi.impl.PyPsiFacadeImpl;
import com.jetbrains.python.psi.impl.PythonASTFactory;
import com.jetbrains.python.psi.impl.PythonLanguageLevelPusher;
import org.jetbrains.annotations.NotNull;
@@ -32,7 +36,10 @@ public class PythonConsoleParsingTest extends ParsingTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
registerExtensionPoint(PythonDialectsTokenSetContributor.EP_NAME, PythonDialectsTokenSetContributor.class);
registerExtension(PythonDialectsTokenSetContributor.EP_NAME, new PythonTokenSetContributor());
addExplicitExtension(LanguageASTFactory.INSTANCE, PythonLanguage.getInstance(), new PythonASTFactory());
getProject().registerService(PyPsiFacade.class, PyPsiFacadeImpl.class);
if (PythonRuntimeService.getInstance() == null) {
myServiceDisposable = Disposer.newDisposable();