Skip to content

Commit

Permalink
Update new extensions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord authored and Pierre-Sassoulas committed Nov 24, 2021
1 parent a6f998b commit 867ba79
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 108 deletions.
4 changes: 2 additions & 2 deletions tests/functional/ext/bad_builtin/bad_builtin_extension.txt
@@ -1,2 +1,2 @@
bad-builtin:3:7::Used builtin function 'map'. Using a list comprehension can be clearer.:HIGH
bad-builtin:4:8::Used builtin function 'filter'. Using a list comprehension can be clearer.:HIGH
bad-builtin:3:7:3:26::Used builtin function 'map'. Using a list comprehension can be clearer.:UNDEFINED
bad-builtin:4:8:4:30::Used builtin function 'filter'. Using a list comprehension can be clearer.:UNDEFINED
@@ -1,4 +1,4 @@
too-many-try-statements:5:0::try clause contains 3 statements, expected at most 1:HIGH
too-many-try-statements:12:0::try clause contains 3 statements, expected at most 1:HIGH
too-many-try-statements:19:0::try clause contains 4 statements, expected at most 1:HIGH
too-many-try-statements:29:0::try clause contains 7 statements, expected at most 1:HIGH
too-many-try-statements:5:0:10:8::try clause contains 3 statements, expected at most 1:UNDEFINED
too-many-try-statements:12:0:17:8::try clause contains 3 statements, expected at most 1:UNDEFINED
too-many-try-statements:19:0:27:8::try clause contains 4 statements, expected at most 1:UNDEFINED
too-many-try-statements:29:0:44:8::try clause contains 7 statements, expected at most 1:UNDEFINED
8 changes: 4 additions & 4 deletions tests/functional/ext/check_elif/check_elif.txt
@@ -1,4 +1,4 @@
else-if-used:13:8:my_function:"Consider using ""elif"" instead of ""else if""":HIGH
else-if-used:25:20:my_function:"Consider using ""elif"" instead of ""else if""":HIGH
else-if-used:44:8:_if_in_fstring_comprehension_with_elif:"Consider using ""elif"" instead of ""else if""":HIGH
else-if-used:47:12:_if_in_fstring_comprehension_with_elif:"Consider using ""elif"" instead of ""else if""":HIGH
else-if-used:13:8:30:25:my_function:"Consider using ""elif"" instead of ""else if""":HIGH
else-if-used:25:20:26:28:my_function:"Consider using ""elif"" instead of ""else if""":HIGH
else-if-used:44:8:48:26:_if_in_fstring_comprehension_with_elif:"Consider using ""elif"" instead of ""else if""":HIGH
else-if-used:47:12:48:26:_if_in_fstring_comprehension_with_elif:"Consider using ""elif"" instead of ""else if""":HIGH
8 changes: 4 additions & 4 deletions tests/functional/ext/comparetozero/comparetozero.txt
@@ -1,4 +1,4 @@
compare-to-zero:6:3::Avoid comparisons to zero:HIGH
compare-to-zero:9:3::Avoid comparisons to zero:HIGH
compare-to-zero:12:3::Avoid comparisons to zero:HIGH
compare-to-zero:15:3::Avoid comparisons to zero:HIGH
compare-to-zero:6:3:6:9::Avoid comparisons to zero:UNDEFINED
compare-to-zero:9:3:9:13::Avoid comparisons to zero:UNDEFINED
compare-to-zero:12:3:12:9::Avoid comparisons to zero:UNDEFINED
compare-to-zero:15:3:15:9::Avoid comparisons to zero:UNDEFINED
14 changes: 7 additions & 7 deletions tests/functional/ext/docstyle/docstyle.txt
@@ -1,7 +1,7 @@
docstring-first-line-empty:4:0:check_messages:First line empty in function docstring:HIGH
docstring-first-line-empty:14:0:FFFF:First line empty in class docstring:HIGH
bad-docstring-quotes:19:4:FFFF.method1:"Bad docstring quotes in method, expected """""", given '''":HIGH
docstring-first-line-empty:19:4:FFFF.method1:First line empty in method docstring:HIGH
bad-docstring-quotes:24:4:FFFF.method2:"Bad docstring quotes in method, expected """""", given """:HIGH
bad-docstring-quotes:27:4:FFFF.method3:"Bad docstring quotes in method, expected """""", given '":HIGH
bad-docstring-quotes:30:4:FFFF.method4:"Bad docstring quotes in method, expected """""", given '":HIGH
docstring-first-line-empty:4:0:7:19:check_messages:First line empty in function docstring:HIGH
docstring-first-line-empty:14:0:41:44:FFFF:First line empty in class docstring:HIGH
bad-docstring-quotes:19:4:22:11:FFFF.method1:"Bad docstring quotes in method, expected """""", given '''":HIGH
docstring-first-line-empty:19:4:22:11:FFFF.method1:First line empty in method docstring:HIGH
bad-docstring-quotes:24:4:25:25:FFFF.method2:"Bad docstring quotes in method, expected """""", given """:HIGH
bad-docstring-quotes:27:4:28:25:FFFF.method3:"Bad docstring quotes in method, expected """""", given '":HIGH
bad-docstring-quotes:30:4:31:30:FFFF.method4:"Bad docstring quotes in method, expected """""", given '":HIGH
8 changes: 4 additions & 4 deletions tests/functional/ext/empty_comment/empty_comment.txt
@@ -1,4 +1,4 @@
empty-comment:3:0::Line with empty comment:HIGH
empty-comment:5:0::Line with empty comment:HIGH
empty-comment:8:0::Line with empty comment:HIGH
empty-comment:11:0::Line with empty comment:HIGH
empty-comment:3:0:None:None::Line with empty comment:UNDEFINED
empty-comment:5:0:None:None::Line with empty comment:UNDEFINED
empty-comment:8:0:None:None::Line with empty comment:UNDEFINED
empty-comment:11:0:None:None::Line with empty comment:UNDEFINED
8 changes: 4 additions & 4 deletions tests/functional/ext/emptystring/empty_string_comparison.txt
@@ -1,4 +1,4 @@
compare-to-empty-string:6:3::Avoid comparisons to empty string:HIGH
compare-to-empty-string:9:3::Avoid comparisons to empty string:HIGH
compare-to-empty-string:12:3::Avoid comparisons to empty string:HIGH
compare-to-empty-string:15:3::Avoid comparisons to empty string:HIGH
compare-to-empty-string:6:3:6:10::Avoid comparisons to empty string:UNDEFINED
compare-to-empty-string:9:3:9:14::Avoid comparisons to empty string:UNDEFINED
compare-to-empty-string:12:3:12:10::Avoid comparisons to empty string:UNDEFINED
compare-to-empty-string:15:3:15:10::Avoid comparisons to empty string:UNDEFINED
30 changes: 15 additions & 15 deletions tests/functional/ext/mccabe/mccabe.txt
@@ -1,15 +1,15 @@
too-complex:9:0:f1:'f1' is too complex. The McCabe rating is 1:HIGH
too-complex:14:0:f2:'f2' is too complex. The McCabe rating is 1:HIGH
too-complex:21:0:f3:'f3' is too complex. The McCabe rating is 3:HIGH
too-complex:31:0:f4:'f4' is too complex. The McCabe rating is 2:HIGH
too-complex:37:0:f5:'f5' is too complex. The McCabe rating is 2:HIGH
too-complex:45:0:f6:'f6' is too complex. The McCabe rating is 2:HIGH
too-complex:53:0:f7:'f7' is too complex. The McCabe rating is 3:HIGH
too-complex:68:0:f8:'f8' is too complex. The McCabe rating is 4:HIGH
too-complex:80:0:f9:'f9' is too complex. The McCabe rating is 9:HIGH
too-complex:106:0:f10:'f10' is too complex. The McCabe rating is 11:HIGH
too-complex:138:4:MyClass1.method1:'method1' is too complex. The McCabe rating is 1:HIGH
too-complex:142:4:MyClass1.method2:'method2' is too complex. The McCabe rating is 18:HIGH
too-many-branches:142:4:MyClass1.method2:Too many branches (20/12):HIGH
too-complex:198:0::This 'for' is too complex. The McCabe rating is 4:HIGH
too-complex:207:0:method3:'method3' is too complex. The McCabe rating is 2:HIGH
too-complex:9:0:11:8:f1:'f1' is too complex. The McCabe rating is 1:HIGH
too-complex:14:0:18:12:f2:'f2' is too complex. The McCabe rating is 1:HIGH
too-complex:21:0:28:47:f3:'f3' is too complex. The McCabe rating is 3:HIGH
too-complex:31:0:34:16:f4:'f4' is too complex. The McCabe rating is 2:HIGH
too-complex:37:0:42:19:f5:'f5' is too complex. The McCabe rating is 2:HIGH
too-complex:45:0:50:16:f6:'f6' is too complex. The McCabe rating is 2:HIGH
too-complex:53:0:65:7:f7:'f7' is too complex. The McCabe rating is 3:HIGH
too-complex:68:0:77:16:f8:'f8' is too complex. The McCabe rating is 4:HIGH
too-complex:80:0:103:25:f9:'f9' is too complex. The McCabe rating is 9:HIGH
too-complex:106:0:130:16:f10:'f10' is too complex. The McCabe rating is 11:HIGH
too-complex:138:4:140:12:MyClass1.method1:'method1' is too complex. The McCabe rating is 1:HIGH
too-complex:142:4:195:21:MyClass1.method2:'method2' is too complex. The McCabe rating is 18:HIGH
too-many-branches:142:4:195:21:MyClass1.method2:Too many branches (20/12):UNDEFINED
too-complex:198:0:204:15::This 'for' is too complex. The McCabe rating is 4:HIGH
too-complex:207:0:216:15:method3:'method3' is too complex. The McCabe rating is 2:HIGH
@@ -1,12 +1,12 @@
overlapping-except:18:7::Overlapping exceptions (SomeException and SomeException are the same):HIGH
overlapping-except:23:7::Overlapping exceptions (SomeException is an ancestor class of SubclassException):HIGH
overlapping-except:28:7::Overlapping exceptions (SomeException and AliasException are the same):HIGH
overlapping-except:33:7::Overlapping exceptions (AliasException is an ancestor class of SubclassException):HIGH
overlapping-except:39:7::Overlapping exceptions (AliasException is an ancestor class of SubclassException):HIGH
overlapping-except:39:7::Overlapping exceptions (SomeException and AliasException are the same):HIGH
overlapping-except:39:7::Overlapping exceptions (SomeException is an ancestor class of SubclassException):HIGH
overlapping-except:44:7::Overlapping exceptions (ArithmeticError is an ancestor class of FloatingPointError):HIGH
overlapping-except:49:7::Overlapping exceptions (ValueError is an ancestor class of UnicodeDecodeError):HIGH
overlapping-except:55:7::Overlapping exceptions (IOError and OSError are the same):HIGH
overlapping-except:60:7::Overlapping exceptions (socket.error and OSError are the same):HIGH
overlapping-except:65:7::Overlapping exceptions (socket.error is an ancestor class of ConnectionError):HIGH
overlapping-except:18:7:18:37::Overlapping exceptions (SomeException and SomeException are the same):UNDEFINED
overlapping-except:23:7:23:41::Overlapping exceptions (SomeException is an ancestor class of SubclassException):UNDEFINED
overlapping-except:28:7:28:38::Overlapping exceptions (SomeException and AliasException are the same):UNDEFINED
overlapping-except:33:7:33:42::Overlapping exceptions (AliasException is an ancestor class of SubclassException):UNDEFINED
overlapping-except:39:7:39:57::Overlapping exceptions (AliasException is an ancestor class of SubclassException):UNDEFINED
overlapping-except:39:7:39:57::Overlapping exceptions (SomeException and AliasException are the same):UNDEFINED
overlapping-except:39:7:39:57::Overlapping exceptions (SomeException is an ancestor class of SubclassException):UNDEFINED
overlapping-except:44:7:44:44::Overlapping exceptions (ArithmeticError is an ancestor class of FloatingPointError):UNDEFINED
overlapping-except:49:7:49:39::Overlapping exceptions (ValueError is an ancestor class of UnicodeDecodeError):UNDEFINED
overlapping-except:55:7:55:25::Overlapping exceptions (IOError and OSError are the same):UNDEFINED
overlapping-except:60:7:60:30::Overlapping exceptions (socket.error and OSError are the same):UNDEFINED
overlapping-except:65:7:65:38::Overlapping exceptions (socket.error is an ancestor class of ConnectionError):UNDEFINED
@@ -1,10 +1,10 @@
redefined-variable-type:17:8:MyClass.__init__:Redefinition of self.var1 type from int to float:HIGH
redefined-variable-type:21:8:MyClass.__init__:Redefinition of a_str type from bool to float:HIGH
redefined-variable-type:33:12:MyClass.some_method.func:Redefinition of var type from int to str:HIGH
redefined-variable-type:37:8:MyClass.some_method:Redefinition of myint type from int to bool:HIGH
redefined-variable-type:39:0::Redefinition of _OK type from bool to str:HIGH
redefined-variable-type:49:4:other_function:Redefinition of instance type from redefined_variable_type.MyClass to bool:HIGH
redefined-variable-type:51:0::Redefinition of SOME_FLOAT type from float to int:HIGH
redefined-variable-type:71:8:func2:Redefinition of var3 type from str to int:HIGH
redefined-variable-type:75:4:func2:Redefinition of var type from bool to int:HIGH
redefined-variable-type:85:8:func2:Redefinition of var4 type from float to str:HIGH
redefined-variable-type:17:8:17:22:MyClass.__init__:Redefinition of self.var1 type from int to float:UNDEFINED
redefined-variable-type:21:8:21:40:MyClass.__init__:Redefinition of a_str type from bool to float:UNDEFINED
redefined-variable-type:33:12:33:23:MyClass.some_method.func:Redefinition of var type from int to str:UNDEFINED
redefined-variable-type:37:8:37:21:MyClass.some_method:Redefinition of myint type from int to bool:UNDEFINED
redefined-variable-type:39:0:39:18::Redefinition of _OK type from bool to str:UNDEFINED
redefined-variable-type:49:4:49:19:other_function:Redefinition of instance type from redefined_variable_type.MyClass to bool:UNDEFINED
redefined-variable-type:51:0:51:29::Redefinition of SOME_FLOAT type from float to int:UNDEFINED
redefined-variable-type:71:8:71:16:func2:Redefinition of var3 type from str to int:UNDEFINED
redefined-variable-type:75:4:75:11:func2:Redefinition of var type from bool to int:UNDEFINED
redefined-variable-type:85:8:85:20:func2:Redefinition of var4 type from float to str:UNDEFINED
26 changes: 0 additions & 26 deletions tests/functional/i/inherit_non_class.txt
@@ -1,28 +1,3 @@
<<<<<<< HEAD
<<<<<<< HEAD
inherit-non-class:21:0:Bad:Inheriting '1', which is not a class.
inherit-non-class:24:0:Bad1:"Inheriting 'lambda abc: 42', which is not a class."
inherit-non-class:27:0:Bad2:Inheriting 'object()', which is not a class.
inherit-non-class:30:0:Bad3:Inheriting 'return_class', which is not a class.
inherit-non-class:33:0:Bad4:Inheriting 'Empty()', which is not a class.
inherit-non-class:68:0:NotInheritableBool:Inheriting 'bool', which is not a class.
inherit-non-class:72:0:NotInheritableRange:Inheriting 'range', which is not a class.
inherit-non-class:76:0:NotInheritableSlice:Inheriting 'slice', which is not a class.
inherit-non-class:80:0:NotInheritableMemoryView:Inheriting 'memoryview', which is not a class.
inherit-non-class:99:0:Child2:Inheriting 'ParentBad[int]', which is not a class.:HIGH
unsubscriptable-object:103:13:Child3:Value 'Empty' is unsubscriptable:HIGH
=======
inherit-non-class:21:0:Bad:Inheriting '1', which is not a class.:HIGH
inherit-non-class:24:0:Bad1:"Inheriting 'lambda abc: 42', which is not a class.":HIGH
inherit-non-class:27:0:Bad2:Inheriting 'object()', which is not a class.:HIGH
inherit-non-class:30:0:Bad3:Inheriting 'return_class', which is not a class.:HIGH
inherit-non-class:33:0:Bad4:Inheriting 'Empty()', which is not a class.:HIGH
inherit-non-class:68:0:NotInheritableBool:Inheriting 'bool', which is not a class.:HIGH
inherit-non-class:72:0:NotInheritableRange:Inheriting 'range', which is not a class.:HIGH
inherit-non-class:76:0:NotInheritableSlice:Inheriting 'slice', which is not a class.:HIGH
inherit-non-class:80:0:NotInheritableMemoryView:Inheriting 'memoryview', which is not a class.:HIGH
>>>>>>> 4bc56a6e... Add ``confidence`` to all expected functional test outputs
=======
inherit-non-class:21:0:22:40:Bad:Inheriting '1', which is not a class.:UNDEFINED
inherit-non-class:24:0:25:38:Bad1:"Inheriting 'lambda abc: 42', which is not a class.":UNDEFINED
inherit-non-class:27:0:28:53:Bad2:Inheriting 'object()', which is not a class.:UNDEFINED
Expand All @@ -34,4 +9,3 @@ inherit-non-class:76:0:77:8:NotInheritableSlice:Inheriting 'slice', which is not
inherit-non-class:80:0:81:8:NotInheritableMemoryView:Inheriting 'memoryview', which is not a class.:UNDEFINED
inherit-non-class:99:0:100:8:Child2:Inheriting 'ParentBad[int]', which is not a class.:UNDEFINED
unsubscriptable-object:103:13:103:18:Child3:Value 'Empty' is unsubscriptable:UNDEFINED
>>>>>>> bf9bbd30... Update tests
16 changes: 0 additions & 16 deletions tests/functional/i/invalid/s/invalid_slice_index.txt
@@ -1,21 +1,5 @@
<<<<<<< HEAD
<<<<<<< HEAD
invalid-slice-index:10:20:function1:Slice index is not an int, None, or instance with __index__:HIGH
invalid-slice-index:10:23:function1:Slice index is not an int, None, or instance with __index__:HIGH
invalid-slice-index:14:20:function2:Slice index is not an int, None, or instance with __index__:HIGH
invalid-slice-index:14:24:function2:Slice index is not an int, None, or instance with __index__:HIGH
invalid-slice-index:23:20:function3:Slice index is not an int, None, or instance with __index__:HIGH
=======
invalid-slice-index:10:0:function1:Slice index is not an int, None, or instance with __index__:HIGH
invalid-slice-index:10:0:function1:Slice index is not an int, None, or instance with __index__:HIGH
invalid-slice-index:14:0:function2:Slice index is not an int, None, or instance with __index__:HIGH
invalid-slice-index:14:0:function2:Slice index is not an int, None, or instance with __index__:HIGH
invalid-slice-index:23:0:function3:Slice index is not an int, None, or instance with __index__:HIGH
>>>>>>> 4bc56a6e... Add ``confidence`` to all expected functional test outputs
=======
invalid-slice-index:10:20:10:22:function1:Slice index is not an int, None, or instance with __index__:UNDEFINED
invalid-slice-index:10:23:10:25:function1:Slice index is not an int, None, or instance with __index__:UNDEFINED
invalid-slice-index:14:20:14:23:function2:Slice index is not an int, None, or instance with __index__:UNDEFINED
invalid-slice-index:14:24:14:27:function2:Slice index is not an int, None, or instance with __index__:UNDEFINED
invalid-slice-index:23:20:23:33:function3:Slice index is not an int, None, or instance with __index__:UNDEFINED
>>>>>>> bf9bbd30... Update tests

0 comments on commit 867ba79

Please sign in to comment.