From 069a2a634091ece09c3636cf3420e47b048fc479 Mon Sep 17 00:00:00 2001 From: Elizaveta Shashkova Date: Tue, 14 Jun 2016 20:26:32 +0300 Subject: [PATCH] Fix tests related to project roots --- .../env/PyExecutionFixtureTestTask.java | 6 +++++- .../env/python/PythonDebuggerTest.java | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/python/testSrc/com/jetbrains/env/PyExecutionFixtureTestTask.java b/python/testSrc/com/jetbrains/env/PyExecutionFixtureTestTask.java index 3c2b0e521b39..4b986048d1ad 100644 --- a/python/testSrc/com/jetbrains/env/PyExecutionFixtureTestTask.java +++ b/python/testSrc/com/jetbrains/env/PyExecutionFixtureTestTask.java @@ -63,7 +63,7 @@ public abstract class PyExecutionFixtureTestTask extends PyTestTask { final boolean customTestData = !testDataPath.equals(getDefaultTestDataPath()); // No need to set default testdata as module root: too many data to index and useless - if (customTestData) { + if (customTestData || shouldAddDataPathToContentRoots()) { moduleFixtureBuilder.addSourceContentRoot(testDataPath); } final List contentRoots = getContentRoots(); @@ -79,6 +79,10 @@ public abstract class PyExecutionFixtureTestTask extends PyTestTask { return PythonTestUtil.getTestDataPath(); } + protected boolean shouldAddDataPathToContentRoots() { + return false; + } + protected List getContentRoots() { return Lists.newArrayList(); } diff --git a/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java b/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java index 75a55557963b..67df890623e9 100644 --- a/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java +++ b/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java @@ -278,6 +278,11 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Test public void testStepIntoMyCode() throws Exception { runPythonTest(new PyDebuggerTask("/debug", "test_my_code.py") { + @Override + protected boolean shouldAddDataPathToContentRoots() { + return true; + } + @Override public void before() throws Exception { toggleBreakpoint(getScriptPath(), 5); @@ -473,6 +478,11 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Test public void testExceptionBreakpointIgnoreLibrariesOnRaise() throws Exception { runPythonTest(new PyDebuggerTask("/debug", "test_ignore_lib.py") { + @Override + protected boolean shouldAddDataPathToContentRoots() { + return true; + } + @Override public void before() throws Exception { createExceptionBreak(myFixture, false, true, true); @@ -497,6 +507,11 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Test public void testExceptionBreakpointIgnoreLibrariesOnTerminate() throws Exception { runPythonTest(new PyDebuggerTask("/debug", "test_ignore_lib.py") { + @Override + protected boolean shouldAddDataPathToContentRoots() { + return true; + } + @Override public void before() throws Exception { createExceptionBreak(myFixture, true, false, true); @@ -880,6 +895,11 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Test public void testSteppingFilter() throws Exception { runPythonTest(new PyDebuggerTask("/debug", "test_stepping_filter.py") { + @Override + protected boolean shouldAddDataPathToContentRoots() { + return true; + } + @Override public void before() throws Exception { toggleBreakpoint(getScriptPath(), 4);