mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
Fixing tests (equals is deprecated in favor of equal)
This commit is contained in:
@@ -4,4 +4,4 @@ from testedCode.my_class import *
|
||||
class MyClassTest(unittest.TestCase):
|
||||
def test_foo(self):
|
||||
c = MyClass()
|
||||
self.assertEquals("bar", c.foo())
|
||||
self.assertEqual("bar", c.foo())
|
||||
|
||||
@@ -4,4 +4,4 @@ from ..utils import util
|
||||
|
||||
class MyTest(unittest.TestCase):
|
||||
def test_multiply(self):
|
||||
self.assertEquals(4, util.multiply(2, 2))
|
||||
self.assertEqual(4, util.multiply(2, 2))
|
||||
|
||||
@@ -44,16 +44,16 @@ public class PyUnitTestProcessRunner extends PyScriptTestProcessRunner<PyUnivers
|
||||
@Override
|
||||
protected void configurationCreatedAndWillLaunch(@NotNull PyUniversalUnitTestConfiguration configuration) throws IOException {
|
||||
super.configurationCreatedAndWillLaunch(configuration);
|
||||
if (PythonSdkFlavor.getFlavor(configuration.getSdk()) instanceof CPythonSdkFlavor) {
|
||||
// -Werror checks we do not use deprecated API in runners, but only works for cpython (not iron nor jython)
|
||||
// and we can't use it for pytest/nose, since it is not our responsibility to check them for deprecation api usage
|
||||
// while unit is part of stdlib and does not use deprecated api, so only runners are checked
|
||||
configuration.setInterpreterOptions("-Werror");
|
||||
}
|
||||
|
||||
if (myScriptName.startsWith(TEST_PATTERN_PREFIX)) {
|
||||
configuration.getTarget().setTargetType(TestTargetType.PATH);
|
||||
configuration.getTarget().setTarget(".");
|
||||
|
||||
if (PythonSdkFlavor.getFlavor(configuration.getSdk()) instanceof CPythonSdkFlavor) {
|
||||
// -Werror checks we do not use deprecated API in runners, but only works for cpython (not iron nor jython)
|
||||
// and we can't use it for pytest/nose, since it is not our responsibility to check them for deprecation api usage
|
||||
// while unit is part of stdlib and does not use deprecated api, so only runners are checked
|
||||
configuration.setInterpreterOptions("-Werror");
|
||||
}
|
||||
configuration.setPattern(myScriptName.substring(TEST_PATTERN_PREFIX.length()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user