From 4561987ee52abefd6fb2d960c3ccb1663436194a Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Wed, 22 Feb 2017 23:07:45 +0300 Subject: [PATCH] Moved map() and filter() for PY2 test into Typeshed test data --- .../PyTypeCheckerInspection/BuiltinFunctions.py | 5 ----- python/testData/typeshed/stdlib/2/builtins_test.py | 8 ++++++++ .../python/inspections/PyTypeCheckerInspectionTest.java | 4 ---- 3 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 python/testData/inspections/PyTypeCheckerInspection/BuiltinFunctions.py create mode 100644 python/testData/typeshed/stdlib/2/builtins_test.py diff --git a/python/testData/inspections/PyTypeCheckerInspection/BuiltinFunctions.py b/python/testData/inspections/PyTypeCheckerInspection/BuiltinFunctions.py deleted file mode 100644 index 9a261da172e7..000000000000 --- a/python/testData/inspections/PyTypeCheckerInspection/BuiltinFunctions.py +++ /dev/null @@ -1,5 +0,0 @@ -def test(): - print(map(str, [1, 2, 3]) + ['foo']) #pass - print(map(lambda x: x.upper(), 'foo')) #pass - print(filter(lambda x: x % 2 == 0, [1, 2, 3]) + [4, 5, 6]) #pass - print(filter(lambda x: x != 'f', 'foo') + 'bar') #pass diff --git a/python/testData/typeshed/stdlib/2/builtins_test.py b/python/testData/typeshed/stdlib/2/builtins_test.py new file mode 100644 index 000000000000..77da23521a00 --- /dev/null +++ b/python/testData/typeshed/stdlib/2/builtins_test.py @@ -0,0 +1,8 @@ +def test_map(): + assert map(str, [1, 2, 3]) + ['foo'] == ['1', '2', '3', 'foo'] + assert map(lambda x: x.upper(), 'foo').pop() == 'O' + + +def test_filter(): + assert filter(lambda x: x % 2 == 0, [1, 2, 3]) + [4, 5, 6] == [2, 4, 5, 6] + assert filter(lambda x: x != 'f', 'foo') + 'bar' == 'oobar' diff --git a/python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java index ce087d4983e2..77b5deabd4c3 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java @@ -103,10 +103,6 @@ public class PyTypeCheckerInspectionTest extends PyTestCase { doTest(); } - public void testBuiltinFunctions() { - doTest(); - } - public void testUnionReturnTypes() { doTest(); }