Fix tests related to project roots

This commit is contained in:
Elizaveta Shashkova
2016-06-14 20:27:09 +03:00
parent ec72b9ebde
commit 069a2a6340
2 changed files with 25 additions and 1 deletions
@@ -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<String> contentRoots = getContentRoots();
@@ -79,6 +79,10 @@ public abstract class PyExecutionFixtureTestTask extends PyTestTask {
return PythonTestUtil.getTestDataPath();
}
protected boolean shouldAddDataPathToContentRoots() {
return false;
}
protected List<String> getContentRoots() {
return Lists.newArrayList();
}
@@ -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);