mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-15837: Escape "[" char in tests
This commit is contained in:
@@ -2,7 +2,7 @@ import sys
|
||||
|
||||
|
||||
class TeamcityServiceMessages:
|
||||
quote = {"'": "|'", "|": "||", "\n": "|n", "\r": "|r", ']': '|]'}
|
||||
quote = {"'": "|'", "|": "||", "\n": "|n", "\r": "|r", ']': '|]', '[': '|['}
|
||||
|
||||
def __init__(self, output=sys.stdout, prepend_linebreak=False):
|
||||
self.output = output
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
from unittest import TestCase
|
||||
|
||||
|
||||
class FooTest(TestCase):
|
||||
def test_test(self):
|
||||
raise Exception("\033[31mError Occurred")
|
||||
@@ -228,6 +228,27 @@ public final class PythonUnitTestingTest extends PyEnvTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure "[" in test does not break output
|
||||
*/
|
||||
@Test
|
||||
public void testEscaping() throws Exception {
|
||||
runPythonTest(new PyUnitTestProcessWithConsoleTestTask("/testRunner/env/unit", "test_escaping.py") {
|
||||
|
||||
|
||||
@Override
|
||||
protected void checkTestResults(@NotNull final PyUnitTestProcessRunner runner,
|
||||
@NotNull final String stdout,
|
||||
@NotNull final String stderr,
|
||||
@NotNull final String all) {
|
||||
assertEquals(1, runner.getAllTestsCount());
|
||||
assertEquals(0, runner.getPassedTestsCount());
|
||||
assertEquals(1, runner.getFailedTestsCount());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClass() {
|
||||
runPythonTest(new PyUnitTestProcessWithConsoleTestTask("/testRunner/env/unit", "test_file.py::GoodTest") {
|
||||
|
||||
Reference in New Issue
Block a user