mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
running all tests in folder rewritten in Jython compatible way; test added
This commit is contained in:
@@ -32,12 +32,14 @@ def loadSource(fileName):
|
||||
modules[moduleName] = module
|
||||
return module
|
||||
|
||||
def walkModules(modules, dirname, names):
|
||||
for name in names:
|
||||
if name.endswith(".py"):
|
||||
modules.append(loadSource(os.path.join(dirname, name)))
|
||||
|
||||
def loadModulesFromFolderRec(folder):
|
||||
modules = []
|
||||
for root, dirs, files in os.walk(folder, topdown=False):
|
||||
for name in files:
|
||||
if name.endswith(".py"):
|
||||
modules.append(loadSource(os.path.join(root, name)))
|
||||
os.path.walk(folder, walkModules, modules)
|
||||
return modules
|
||||
|
||||
testLoader = unittest.TestLoader()
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import unittest
|
||||
|
||||
class SubTest(unittest.TestCase):
|
||||
def test_in_subfolder(self):
|
||||
self.assertEquals("foo", "fo" + "o")
|
||||
|
||||
|
||||
@@ -62,6 +62,12 @@ public class PyTestRunnerTest extends LightPlatformTestCase {
|
||||
assertEquals(3, result.length);
|
||||
}
|
||||
|
||||
public void testFolder() throws ExecutionException {
|
||||
final File testDir = new File(PathManager.getHomePath(), "plugins/python/testData/testRunner/tests");
|
||||
String[] result = runUTRunner(testDir.getPath(), testDir.getPath() + "/");
|
||||
assertEquals(8, result.length);
|
||||
}
|
||||
|
||||
private static String[] runUTRunner(String workDir, String... args) throws ExecutionException {
|
||||
File helpersDir = new File(PathManager.getHomePath(), "plugins/python/helpers");
|
||||
File utRunner = new File(helpersDir, "pycharm/utrunner.py");
|
||||
|
||||
Reference in New Issue
Block a user