diff options
| author | Torsten Marek <shlomme@gmail.com> | 2014-08-16 20:16:08 -0700 |
|---|---|---|
| committer | Torsten Marek <shlomme@gmail.com> | 2014-08-16 20:16:08 -0700 |
| commit | a7d1515daef1234b3bf3e3991299771bea3c56bc (patch) | |
| tree | 95acc685425f42c11ad5b2d45f7fecf3e439b90f | |
| parent | 20ffb646e24da344602c705be938f2f6baac0494 (diff) | |
| download | pylint-a7d1515daef1234b3bf3e3991299771bea3c56bc.tar.gz | |
Expected output files for the new test framework are now CSV files.
CSV files are easier to parse (messages with multi-line output were
parsed with a heuristic so far), and are easier to extend with new fields.
| -rw-r--r-- | test/functional/anomalous_unicode_escape.txt | 6 | ||||
| -rw-r--r-- | test/functional/bad_continuation.txt | 86 | ||||
| -rw-r--r-- | test/functional/bad_open_mode.txt | 14 | ||||
| -rw-r--r-- | test/functional/class_members_py27.txt | 12 | ||||
| -rw-r--r-- | test/functional/docstrings.txt | 16 | ||||
| -rw-r--r-- | test/functional/exception_is_binary_op.txt | 8 | ||||
| -rw-r--r-- | test/functional/future_unicode_literals.txt | 2 | ||||
| -rw-r--r-- | test/functional/import_error.txt | 4 | ||||
| -rw-r--r-- | test/functional/invalid_encoded_data.txt | 2 | ||||
| -rw-r--r-- | test/functional/invalid_exceptions_caught.txt | 6 | ||||
| -rw-r--r-- | test/functional/invalid_exceptions_raised.txt | 12 | ||||
| -rw-r--r-- | test/functional/invalid_name.txt | 4 | ||||
| -rw-r--r-- | test/functional/missing_self_argument.txt | 4 | ||||
| -rw-r--r-- | test/functional/name_styles.txt | 34 | ||||
| -rw-r--r-- | test/functional/newstyle_properties.txt | 2 | ||||
| -rw-r--r-- | test/functional/statement_without_effect.txt | 72 | ||||
| -rw-r--r-- | test/functional/string_formatting.txt | 2 | ||||
| -rw-r--r-- | test/functional/too_many_branches.txt | 2 | ||||
| -rw-r--r-- | test/test_functional.py | 35 |
19 files changed, 185 insertions, 138 deletions
diff --git a/test/functional/anomalous_unicode_escape.txt b/test/functional/anomalous_unicode_escape.txt index 5c1acc7..c242cb9 100644 --- a/test/functional/anomalous_unicode_escape.txt +++ b/test/functional/anomalous_unicode_escape.txt @@ -1,3 +1,3 @@ -anomalous-unicode-escape-in-string:5::Anomalous Unicode escape in byte string: '\u'. String constant might be missing an r or u prefix. -anomalous-unicode-escape-in-string:6::Anomalous Unicode escape in byte string: '\U'. String constant might be missing an r or u prefix. -anomalous-unicode-escape-in-string:8::Anomalous Unicode escape in byte string: '\N'. String constant might be missing an r or u prefix. +anomalous-unicode-escape-in-string:5::"Anomalous Unicode escape in byte string: '\u'. String constant might be missing an r or u prefix." +anomalous-unicode-escape-in-string:6::"Anomalous Unicode escape in byte string: '\U'. String constant might be missing an r or u prefix." +anomalous-unicode-escape-in-string:8::"Anomalous Unicode escape in byte string: '\N'. String constant might be missing an r or u prefix." diff --git a/test/functional/bad_continuation.txt b/test/functional/bad_continuation.txt index 732858e..f970780 100644 --- a/test/functional/bad_continuation.txt +++ b/test/functional/bad_continuation.txt @@ -1,63 +1,63 @@ -bad-continuation:12::Wrong hanging indentation. +bad-continuation:12::"Wrong hanging indentation. ] # [bad-continuation] -| ^| -bad-continuation:17::Wrong continued indentation. +| ^|" +bad-continuation:17::"Wrong continued indentation. 7, # [bad-continuation] - | ^ -bad-continuation:25::Wrong hanging indentation. + | ^" +bad-continuation:25::"Wrong hanging indentation. 'b': 2, # [bad-continuation] - ^| -bad-continuation:31::Wrong hanging indentation. + ^|" +bad-continuation:31::"Wrong hanging indentation. 'b': 2, # [bad-continuation] - ^| -bad-continuation:39::Wrong continued indentation. + ^|" +bad-continuation:39::"Wrong continued indentation. # [bad-continuation] is not accepted - | | ^ -bad-continuation:40::Wrong continued indentation. + | | ^" +bad-continuation:40::"Wrong continued indentation. 'contents', # [bad-continuation] nor this. - | ^ -bad-continuation:49::Wrong hanging indentation in dict value. + | ^" +bad-continuation:49::"Wrong hanging indentation in dict value. 'value2', # [bad-continuation] - | ^ | -bad-continuation:59::Wrong continued indentation. + | ^ |" +bad-continuation:59::"Wrong continued indentation. 'wrong', # [bad-continuation] - ^ | -bad-continuation:83::Wrong hanging indentation in dict value. + ^ |" +bad-continuation:83::"Wrong hanging indentation in dict value. 'value1', # [bad-continuation] -^ | | -bad-continuation:87::Wrong hanging indentation in dict value. +^ | |" +bad-continuation:87::"Wrong hanging indentation in dict value. 'value1', # [bad-continuation] - ^ | | -bad-continuation:104::Wrong hanging indentation before block. + ^ | |" +bad-continuation:104::"Wrong hanging indentation before block. some_arg, # [bad-continuation] - ^ | -bad-continuation:105::Wrong hanging indentation before block. + ^ |" +bad-continuation:105::"Wrong hanging indentation before block. some_other_arg): # [bad-continuation] - ^ | -bad-continuation:125::Wrong continued indentation. - "b") # [bad-continuation] - ^ | -bad-continuation:139::Wrong hanging indentation before block. + ^ |" +bad-continuation:125::"Wrong continued indentation. + ""b"") # [bad-continuation] + ^ |" +bad-continuation:139::"Wrong hanging indentation before block. ): pass # [bad-continuation] -| ^| -bad-continuation:142::Wrong continued indentation before block. +| ^|" +bad-continuation:142::"Wrong continued indentation before block. 2): # [bad-continuation] - ^ | -bad-continuation:150::Wrong continued indentation. + ^ |" +bad-continuation:150::"Wrong continued indentation. 2 and # [bad-continuation] - | ^ -bad-continuation:155::Wrong hanging indentation before block. + | ^" +bad-continuation:155::"Wrong hanging indentation before block. 2): pass # [bad-continuation] - ^ | | -bad-continuation:162::Wrong continued indentation before block. + ^ | |" +bad-continuation:162::"Wrong continued indentation before block. 2 or # [bad-continuation] - |^ | -bad-continuation:166::Wrong continued indentation before block. + |^ |" +bad-continuation:166::"Wrong continued indentation before block. 2): pass # [bad-continuation] - ^ | | -bad-continuation:172::Wrong hanging indentation before block. + ^ | |" +bad-continuation:172::"Wrong hanging indentation before block. 2): # [bad-continuation] - ^ | | -bad-continuation:183::Wrong continued indentation. + ^ | |" +bad-continuation:183::"Wrong continued indentation. 2): # [bad-continuation] - ^ | + ^ |" diff --git a/test/functional/bad_open_mode.txt b/test/functional/bad_open_mode.txt index 356e02e..d0bb8bb 100644 --- a/test/functional/bad_open_mode.txt +++ b/test/functional/bad_open_mode.txt @@ -1,7 +1,7 @@ -bad-open-mode:4::"rw" is not a valid mode for open. -bad-open-mode:5::"rw" is not a valid mode for open. -bad-open-mode:6::"rw" is not a valid mode for open. -bad-open-mode:7::"U+" is not a valid mode for open. -bad-open-mode:8::"rb+" is not a valid mode for open. -bad-open-mode:9::"Uw" is not a valid mode for open. -bad-open-mode:13::"Uwz" is not a valid mode for open. +bad-open-mode:4::"""rw"" is not a valid mode for open." +bad-open-mode:5::"""rw"" is not a valid mode for open." +bad-open-mode:6::"""rw"" is not a valid mode for open." +bad-open-mode:7::"""U+"" is not a valid mode for open." +bad-open-mode:8::"""rb+"" is not a valid mode for open." +bad-open-mode:9::"""Uw"" is not a valid mode for open." +bad-open-mode:13::"""Uwz"" is not a valid mode for open." diff --git a/test/functional/class_members_py27.txt b/test/functional/class_members_py27.txt index 3e88b55..c7b017e 100644 --- a/test/functional/class_members_py27.txt +++ b/test/functional/class_members_py27.txt @@ -1,6 +1,6 @@ -no-member:14:MyClass.test:Instance of 'MyClass' has no 'incorrect' member
-no-member:15:MyClass.test:Instance of 'MyClass' has no 'havenot' member
-no-member:16:MyClass.test:Instance of 'MyClass' has no 'nonexistent1' member
-no-member:17:MyClass.test:Instance of 'MyClass' has no 'nonexistent2' member
-no-member:50::Instance of 'TestMetaclass' has no 'register' member
-no-member:51::Instance of 'UsingMetaclass' has no 'test' member
+no-member:14:MyClass.test:Instance of 'MyClass' has no 'incorrect' member +no-member:15:MyClass.test:Instance of 'MyClass' has no 'havenot' member +no-member:16:MyClass.test:Instance of 'MyClass' has no 'nonexistent1' member +no-member:17:MyClass.test:Instance of 'MyClass' has no 'nonexistent2' member +no-member:50::Instance of 'TestMetaclass' has no 'register' member +no-member:51::Instance of 'UsingMetaclass' has no 'test' member diff --git a/test/functional/docstrings.txt b/test/functional/docstrings.txt index 1ea5c7d..177d02a 100644 --- a/test/functional/docstrings.txt +++ b/test/functional/docstrings.txt @@ -1,8 +1,8 @@ -missing-docstring:1::Missing module docstring
-empty-docstring:6:function0:Empty function docstring
-missing-docstring:10:function1:Missing function docstring
-missing-docstring:23:AAAA:Missing class docstring
-missing-docstring:40:AAAA.method1:Missing method docstring
-empty-docstring:48:AAAA.method3:Empty method docstring
-empty-docstring:62:DDDD.method2:Empty method docstring
-missing-docstring:70:DDDD.method4:Missing method docstring
+missing-docstring:1::Missing module docstring +empty-docstring:6:function0:Empty function docstring +missing-docstring:10:function1:Missing function docstring +missing-docstring:23:AAAA:Missing class docstring +missing-docstring:40:AAAA.method1:Missing method docstring +empty-docstring:48:AAAA.method3:Empty method docstring +empty-docstring:62:DDDD.method2:Empty method docstring +missing-docstring:70:DDDD.method4:Missing method docstring diff --git a/test/functional/exception_is_binary_op.txt b/test/functional/exception_is_binary_op.txt index 039bc3f..e6512c9 100644 --- a/test/functional/exception_is_binary_op.txt +++ b/test/functional/exception_is_binary_op.txt @@ -1,4 +1,4 @@ -binary-op-exception:5::Exception to catch is the result of a binary "or" operation -binary-op-exception:7::Exception to catch is the result of a binary "and" operation -binary-op-exception:9::Exception to catch is the result of a binary "or" operation -binary-op-exception:11::Exception to catch is the result of a binary "or" operation +binary-op-exception:5::"Exception to catch is the result of a binary ""or"" operation" +binary-op-exception:7::"Exception to catch is the result of a binary ""and"" operation" +binary-op-exception:9::"Exception to catch is the result of a binary ""or"" operation" +binary-op-exception:11::"Exception to catch is the result of a binary ""or"" operation" diff --git a/test/functional/future_unicode_literals.txt b/test/functional/future_unicode_literals.txt index c490da5..60d291e 100644 --- a/test/functional/future_unicode_literals.txt +++ b/test/functional/future_unicode_literals.txt @@ -1 +1 @@ -anomalous-unicode-escape-in-string:5::Anomalous Unicode escape in byte string: '\u'. String constant might be missing an r or u prefix. +anomalous-unicode-escape-in-string:5::"Anomalous Unicode escape in byte string: '\u'. String constant might be missing an r or u prefix." diff --git a/test/functional/import_error.txt b/test/functional/import_error.txt index af7f739..0602d2a 100644 --- a/test/functional/import_error.txt +++ b/test/functional/import_error.txt @@ -1,2 +1,2 @@ -import-error:3::Unable to import 'totally_missing'
-import-error:16::Unable to import 'maybe_missing_2'
+import-error:3::Unable to import 'totally_missing' +import-error:16::Unable to import 'maybe_missing_2' diff --git a/test/functional/invalid_encoded_data.txt b/test/functional/invalid_encoded_data.txt index dc23869..c6e69dc 100644 --- a/test/functional/invalid_encoded_data.txt +++ b/test/functional/invalid_encoded_data.txt @@ -1 +1 @@ -invalid-encoded-data:5::Cannot decode using encoding "utf-8", unexpected byte at position 11 +invalid-encoded-data:5::"Cannot decode using encoding ""utf-8"", unexpected byte at position 11" diff --git a/test/functional/invalid_exceptions_caught.txt b/test/functional/invalid_exceptions_caught.txt index 55b653b..3156a0b 100644 --- a/test/functional/invalid_exceptions_caught.txt +++ b/test/functional/invalid_exceptions_caught.txt @@ -1,6 +1,6 @@ -catching-non-exception:25::Catching an exception which doesn't inherit from BaseException: MyException -catching-non-exception:31::Catching an exception which doesn't inherit from BaseException: MyException -catching-non-exception:31::Catching an exception which doesn't inherit from BaseException: MySecondException +catching-non-exception:25::"Catching an exception which doesn't inherit from BaseException: MyException" +catching-non-exception:31::"Catching an exception which doesn't inherit from BaseException: MyException" +catching-non-exception:31::"Catching an exception which doesn't inherit from BaseException: MySecondException" catching-non-exception:52::Catching an exception which doesn't inherit from BaseException: None catching-non-exception:52::Catching an exception which doesn't inherit from BaseException: list() catching-non-exception:57::Catching an exception which doesn't inherit from BaseException: None diff --git a/test/functional/invalid_exceptions_raised.txt b/test/functional/invalid_exceptions_raised.txt index 756d92c..c40eca7 100644 --- a/test/functional/invalid_exceptions_raised.txt +++ b/test/functional/invalid_exceptions_raised.txt @@ -1,9 +1,13 @@ -raising-non-exception:23:bad_case0:Raising a new style class which doesn't inherit from BaseException -nonstandard-exception:23:bad_case0:Exception doesn't inherit from standard "Exception" class +nonstandard-exception:23:bad_case0:"Exception doesn't inherit from standard ""Exception"" class" +raising-non-exception:23:bad_case0:"""Raising a new style class which doesn't inherit from BaseException +"" +" raising-non-exception:27:bad_case1:Raising a new style class which doesn't inherit from BaseException -raising-non-exception:33:bad_case2:Raising a new style class which doesn't inherit from BaseException -nonstandard-exception:33:bad_case2:Exception doesn't inherit from standard "Exception" class +nonstandard-exception:33:bad_case2:"Exception doesn't inherit from standard ""Exception"" class" old-raise-syntax:33:bad_case2:Use raise ErrorClass(args) instead of raise ErrorClass, args. +raising-non-exception:33:bad_case2:"""Raising a new style class which doesn't inherit from BaseException +"" +" raising-non-exception:37:bad_case3:Raising a new style class which doesn't inherit from BaseException notimplemented-raised:42:bad_case4:NotImplemented raised - should raise NotImplementedError old-raise-syntax:42:bad_case4:Use raise ErrorClass(args) instead of raise ErrorClass, args. diff --git a/test/functional/invalid_name.txt b/test/functional/invalid_name.txt index c722861..0c8eafe 100644 --- a/test/functional/invalid_name.txt +++ b/test/functional/invalid_name.txt @@ -1,2 +1,2 @@ -invalid-name:10::Invalid constant name "aaa"
-invalid-name:14::Invalid constant name "time"
+invalid-name:10::"Invalid constant name ""aaa""" +invalid-name:14::"Invalid constant name ""time""" diff --git a/test/functional/missing_self_argument.txt b/test/functional/missing_self_argument.txt index 3f7f7f2..1deef18 100644 --- a/test/functional/missing_self_argument.txt +++ b/test/functional/missing_self_argument.txt @@ -1,4 +1,6 @@ no-method-argument:11:MyClass.method:Method has no argument -no-method-argument:13:MyClass.met:Method has no argument +no-method-argument:13:MyClass.met:"""Method has no argument +"" +" no-method-argument:14:MyClass.setup:Method has no argument undefined-variable:16:MyClass.setup:Undefined variable 'self' diff --git a/test/functional/name_styles.txt b/test/functional/name_styles.txt index 4f0ae53..985e9a2 100644 --- a/test/functional/name_styles.txt +++ b/test/functional/name_styles.txt @@ -1,17 +1,17 @@ -invalid-name:6::Invalid constant name "bad_const_name" -invalid-name:9:BADFUNCTION_name:Invalid function name "BADFUNCTION_name" -invalid-name:11:BADFUNCTION_name:Invalid variable name "BAD_LOCAL_VAR" -invalid-name:15:func_bad_argname:Invalid argument name "NOT_GOOD" -invalid-name:25:bad_class_name:Invalid class name "bad_class_name" -invalid-name:36:CorrectClassName.__init__:Invalid attribute name "_Bad_AtTR_name" -invalid-name:37:CorrectClassName.__init__:Invalid attribute name "Bad_PUBLIC_name" -invalid-name:39:CorrectClassName:Invalid class attribute name "zz" -invalid-name:42:CorrectClassName.BadMethodName:Invalid method name "BadMethodName" -invalid-name:48:CorrectClassName.__DunDER_IS_not_free_for_all__:Invalid method name "__DunDER_IS_not_free_for_all__" -invalid-name:78::Invalid class name "BAD_NAME_FOR_CLASS" -invalid-name:79::Invalid class name "NEXT_BAD_NAME_FOR_CLASS" -invalid-name:86::Invalid class name "NOT_CORRECT" -invalid-name:92:test_globals:Invalid constant name "AlsoCorrect" -invalid-name:105:FooClass.PROPERTY_NAME:Invalid attribute name "PROPERTY_NAME" -invalid-name:110:FooClass.ABSTRACT_PROPERTY_NAME:Invalid attribute name "ABSTRACT_PROPERTY_NAME" -invalid-name:115:FooClass.PROPERTY_NAME_SETTER:Invalid attribute name "PROPERTY_NAME_SETTER" +invalid-name:6::"Invalid constant name ""bad_const_name""" +invalid-name:9:BADFUNCTION_name:"Invalid function name ""BADFUNCTION_name""" +invalid-name:11:BADFUNCTION_name:"Invalid variable name ""BAD_LOCAL_VAR""" +invalid-name:15:func_bad_argname:"Invalid argument name ""NOT_GOOD""" +invalid-name:25:bad_class_name:"Invalid class name ""bad_class_name""" +invalid-name:36:CorrectClassName.__init__:"Invalid attribute name ""_Bad_AtTR_name""" +invalid-name:37:CorrectClassName.__init__:"Invalid attribute name ""Bad_PUBLIC_name""" +invalid-name:39:CorrectClassName:"Invalid class attribute name ""zz""" +invalid-name:42:CorrectClassName.BadMethodName:"Invalid method name ""BadMethodName""" +invalid-name:48:CorrectClassName.__DunDER_IS_not_free_for_all__:"Invalid method name ""__DunDER_IS_not_free_for_all__""" +invalid-name:78::"Invalid class name ""BAD_NAME_FOR_CLASS""" +invalid-name:79::"Invalid class name ""NEXT_BAD_NAME_FOR_CLASS""" +invalid-name:86::"Invalid class name ""NOT_CORRECT""" +invalid-name:92:test_globals:"Invalid constant name ""AlsoCorrect""" +invalid-name:105:FooClass.PROPERTY_NAME:"Invalid attribute name ""PROPERTY_NAME""" +invalid-name:110:FooClass.ABSTRACT_PROPERTY_NAME:"Invalid attribute name ""ABSTRACT_PROPERTY_NAME""" +invalid-name:115:FooClass.PROPERTY_NAME_SETTER:"Invalid attribute name ""PROPERTY_NAME_SETTER""" diff --git a/test/functional/newstyle_properties.txt b/test/functional/newstyle_properties.txt index f3a8dbb..9f060c0 100644 --- a/test/functional/newstyle_properties.txt +++ b/test/functional/newstyle_properties.txt @@ -1,2 +1,2 @@ old-style-class:13:OldStyleClass:Old-style class defined. -property-on-old-class:15:OldStyleClass:Use of "property" on an old style class +property-on-old-class:15:OldStyleClass:"Use of ""property"" on an old style class" diff --git a/test/functional/statement_without_effect.txt b/test/functional/statement_without_effect.txt index 636a441..81fc51b 100644 --- a/test/functional/statement_without_effect.txt +++ b/test/functional/statement_without_effect.txt @@ -1,28 +1,60 @@ pointless-string-statement:5::String statement has no effect -pointless-statement:6::Statement seems to have no effect -pointless-statement:8::Statement seems to have no effect +pointless-statement:6::"""Statement seems to have no effect +"" +" +pointless-statement:8::"""Statement seems to have no effect +"" +" pointless-statement:9::Statement seems to have no effect pointless-statement:11::Statement seems to have no effect -pointless-statement:12::Statement seems to have no effect +pointless-statement:12::"""Statement seems to have no effect +"" +" pointless-statement:15::Statement seems to have no effect -pointless-string-statement:15::String statement has no effect -unnecessary-semicolon:17::Unnecessary semicolon +pointless-string-statement:15::"""String statement has no effect +"" +" +unnecessary-semicolon:17::"""Unnecessary semicolon +"" +" pointless-string-statement:18::String statement has no effect -unnecessary-semicolon:18::Unnecessary semicolon -expression-not-assigned:19::Expression "(list()) and (tuple())" is assigned to nothing -expression-not-assigned:20::Expression "(list()) and (tuple())" is assigned to nothing +unnecessary-semicolon:18::"""Unnecessary semicolon +"" +" +expression-not-assigned:19::"""Expression """"(list()) and (tuple())"""" is assigned to nothing +"" +" +expression-not-assigned:20::"""Expression """"(list()) and (tuple())"""" is assigned to nothing +"" +" unnecessary-semicolon:21::Unnecessary semicolon -expression-not-assigned:23::Expression "(list()) and (tuple())" is assigned to nothing -expression-not-assigned:26::Expression "ANSWER == to_be()" is assigned to nothing -expression-not-assigned:27::Expression "ANSWER == to_be()" is assigned to nothing -expression-not-assigned:28::Expression "(to_be()) or (not to_be())" is assigned to nothing -expression-not-assigned:29::Expression "(to_be()) or (not to_be())" is assigned to nothing -expression-not-assigned:30::Expression "ANSWER == to_be()" is assigned to nothing -expression-not-assigned:32::Expression "(to_be()) or (not to_be())" is assigned to nothing -expression-not-assigned:33::Expression "to_be().title" is assigned to nothing -pointless-string-statement:54:ClassLevelAttributeTest.__init__:String statement has no effect -pointless-string-statement:55:ClassLevelAttributeTest.__init__:String statement has no effect +expression-not-assigned:23::"Expression ""(list()) and (tuple())"" is assigned to nothing" +expression-not-assigned:26::"""Expression """"ANSWER == to_be()"""" is assigned to nothing +"" +" +expression-not-assigned:27::"""Expression """"ANSWER == to_be()"""" is assigned to nothing +"" +" +expression-not-assigned:28::"""Expression """"(to_be()) or (not to_be())"""" is assigned to nothing +"" +" +expression-not-assigned:29::"""Expression """"(to_be()) or (not to_be())"""" is assigned to nothing +"" +" +expression-not-assigned:30::"Expression ""ANSWER == to_be()"" is assigned to nothing" +expression-not-assigned:32::"Expression ""(to_be()) or (not to_be())"" is assigned to nothing" +expression-not-assigned:33::"Expression ""to_be().title"" is assigned to nothing" +pointless-string-statement:54:ClassLevelAttributeTest.__init__:"""String statement has no effect +"" +" +pointless-string-statement:55:ClassLevelAttributeTest.__init__:"""String statement has no effect +"" +" pointless-string-statement:58:ClassLevelAttributeTest.__init__:String statement has no effect -pointless-string-statement:61:ClassLevelAttributeTest.test:String statement has no effect -pointless-string-statement:62:ClassLevelAttributeTest.test:String statement has no effect +pointless-string-statement:61:ClassLevelAttributeTest.test:"""String statement has no effect +"" +" +pointless-string-statement:62:ClassLevelAttributeTest.test:"""String statement has no effect +"" +" pointless-string-statement:65:ClassLevelAttributeTest.test:String statement has no effect diff --git a/test/functional/string_formatting.txt b/test/functional/string_formatting.txt index 5f27835..593c161 100644 --- a/test/functional/string_formatting.txt +++ b/test/functional/string_formatting.txt @@ -16,7 +16,7 @@ missing-format-argument-key:71:pprint_bad:Missing keyword argument 'b' for forma missing-format-argument-key:72:pprint_bad:Missing keyword argument 'a' for format string missing-format-attribute:74:pprint_bad:Missing format attribute 'length' in format specifier 'a.ids.__len__.length' invalid-format-index:75:pprint_bad:Using invalid lookup key 400 in format specifier 'a.ids[3][400]' -invalid-format-index:76:pprint_bad:Using invalid lookup key "'string'" in format specifier 'a.ids[3]["\'string\'"]' +invalid-format-index:76:pprint_bad:"Using invalid lookup key ""'string'"" in format specifier 'a.ids[3][""\'string\'""]'" invalid-format-index:77:pprint_bad:Using invalid lookup key 1 in format specifier '0[0][1]' invalid-format-index:78:pprint_bad:Using invalid lookup key 0 in format specifier '0[0][0]' missing-format-argument-key:80:pprint_bad:Missing keyword argument 'b' for format string diff --git a/test/functional/too_many_branches.txt b/test/functional/too_many_branches.txt index 434dc3e..fbc82cc 100644 --- a/test/functional/too_many_branches.txt +++ b/test/functional/too_many_branches.txt @@ -1 +1 @@ -too-many-branches:3:wrong:Too many branches (13/12)
+too-many-branches:3:wrong:Too many branches (13/12) diff --git a/test/test_functional.py b/test/test_functional.py index daf699f..759a447 100644 --- a/test/test_functional.py +++ b/test/test_functional.py @@ -1,5 +1,6 @@ """Functional full-module tests for PyLint.""" from __future__ import unicode_literals +import csv import collections import ConfigParser import io @@ -14,6 +15,18 @@ from pylint import lint from pylint import reporters from pylint import utils +class test_dialect(csv.excel): + if sys.version_info[0] < 3: + delimiter = b':' + lineterminator = b'\n' + else: + delimiter = ':' + lineterminator = '\n' + + +csv.register_dialect('test', test_dialect) + + class NoFileError(Exception): pass @@ -27,7 +40,11 @@ class OutputLine(collections.namedtuple('OutputLine', ['symbol', 'lineno', 'object', 'msg'])): @classmethod def from_msg(cls, msg): - return cls(msg.symbol, msg.line, msg.obj or '', msg.msg + '\n') + return cls(msg.symbol, msg.line, msg.obj or '', msg.msg) + + @classmethod + def from_csv(cls, row): + return cls(row[0], int(row[1]), row[2], row[3]) # Common sub-expressions. @@ -123,16 +140,7 @@ _OPERATORS = { } def parse_expected_output(stream): - lines = [] - for line in stream: - parts = line.split(':', 3) - if len(parts) != 4: - symbol, lineno, obj, msg = lines.pop() - lines.append(OutputLine(symbol, lineno, obj, msg + line)) - else: - linenum = int(parts[1]) - lines.append(OutputLine(parts[0], linenum, parts[2], parts[3])) - return lines + return [OutputLine.from_csv(row) for row in csv.reader(stream, 'test')] def get_expected_messages(stream): @@ -295,9 +303,10 @@ class LintModuleOutputUpdate(LintModuleTest): remaining.extend(received_lines) remaining.sort(key=lambda m: (m[1], m[0], m[3])) with open(self._test_file.expected_output, 'w') as fobj: + writer = csv.writer(fobj, dialect='test') for line in remaining: - fobj.write('{0}:{1}:{2}:{3}'.format(*line)) - + #fobj.write('{0}:{1}:{2}:{3}'.format(*line)) + writer.writerow(line) def suite(): input_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), |
