Fixing tests (equals is deprecated in favor of equal)

This commit is contained in:
Ilya.Kazakevich
2017-03-16 17:44:31 +03:00
parent 1c88703af6
commit aa9306d06c
3 changed files with 9 additions and 9 deletions

View File

@@ -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())

View File

@@ -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))

View File

@@ -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()));
}
}