diff options
author | Brett Cannon <brett@python.org> | 2014-10-10 13:41:08 -0400 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2014-10-10 13:41:08 -0400 |
commit | f8ec9be846a8649bcaed67be2685585468cd5410 (patch) | |
tree | 34052be60467a2ca784948c6834ffe92c90a5082 /test/input | |
parent | 9222fa275215db357efae1d1d6b676da84e85a14 (diff) | |
download | pylint-f8ec9be846a8649bcaed67be2685585468cd5410.tar.gz |
Emit an error when a print statement is used.
Part of issue #20.
Diffstat (limited to 'test/input')
69 files changed, 126 insertions, 134 deletions
diff --git a/test/input/func_3k_removed_stuff_py_30.py b/test/input/func_3k_removed_stuff_py_30.py index 69d4eea..c47b9e5 100644 --- a/test/input/func_3k_removed_stuff_py_30.py +++ b/test/input/func_3k_removed_stuff_py_30.py @@ -1,13 +1,13 @@ """test relative import """ __revision__ = filter(None, map(str, (1, 2, 3))) -from __future__ import generators +from __future__ import generators, print_function import func_w0302 def function(): """something""" - print func_w0302 + print(func_w0302) unic = u"unicode" low = unic.looower return low diff --git a/test/input/func_attrs_definition_order.py b/test/input/func_attrs_definition_order.py index 3c65d73..896426d 100644 --- a/test/input/func_attrs_definition_order.py +++ b/test/input/func_attrs_definition_order.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903 +# pylint: disable=R0903, print-statement """yo""" __revision__ = '$I$' diff --git a/test/input/func_backtick_deprecated_py_30.py b/test/input/func_backtick_deprecated_py_30.py index bca85cc..db3203b 100644 --- a/test/input/func_backtick_deprecated_py_30.py +++ b/test/input/func_backtick_deprecated_py_30.py @@ -1,4 +1,4 @@ """W0333: flag backtick as deprecated""" - +from __future__ import print_function __revision__ = None -print `1` +print(`1`) diff --git a/test/input/func_bad_assigment_to_exception_var.py b/test/input/func_bad_assigment_to_exception_var.py index 6b859ba..61892ce 100644 --- a/test/input/func_bad_assigment_to_exception_var.py +++ b/test/input/func_bad_assigment_to_exception_var.py @@ -1,4 +1,4 @@ -# pylint:disable=C0103 +# pylint:disable=C0103, print-statement """ho ho ho""" __revision__ = 'toto' @@ -28,4 +28,3 @@ def reraise(): raise exc raise e3 - diff --git a/test/input/func_base_useless_pass.py b/test/input/func_base_useless_pass.py index 67c39fa..9faae59 100644 --- a/test/input/func_base_useless_pass.py +++ b/test/input/func_base_useless_pass.py @@ -5,5 +5,5 @@ __revision__ = None try: A = 2 except ValueError: - print A + print A # pylint: disable=print-statement pass diff --git a/test/input/func_block_disable_msg.py b/test/input/func_block_disable_msg.py index 480eac0..927b218 100644 --- a/test/input/func_block_disable_msg.py +++ b/test/input/func_block_disable_msg.py @@ -1,4 +1,4 @@ -# pylint: disable=C0302,bare-except +# pylint: disable=C0302,bare-except,print-statement """pylint option block-disable""" __revision__ = None diff --git a/test/input/func_break_or_return_in_try_finally.py b/test/input/func_break_or_return_in_try_finally.py index 303ac45..d9a50f9 100644 --- a/test/input/func_break_or_return_in_try_finally.py +++ b/test/input/func_break_or_return_in_try_finally.py @@ -1,12 +1,12 @@ 'Exeptions may be silently swallowed' - +from __future__ import print_function __revision__ = None def insidious_break_and_return(): """I found you !""" for i in range(0, -5, -1): my_var = 0 - print i + print(i) try: my_var += 1.0/i if i < -3: diff --git a/test/input/func_dangerous_default.py b/test/input/func_dangerous_default.py index 8bf2c3f..768f70f 100644 --- a/test/input/func_dangerous_default.py +++ b/test/input/func_dangerous_default.py @@ -1,5 +1,5 @@ """docstring""" - +# pylint: disable=print-statement __revision__ = '' HEHE = {} diff --git a/test/input/func_deprecated_module_py_30.py b/test/input/func_deprecated_module_py_30.py index 89d362d..db0dc3f 100644 --- a/test/input/func_deprecated_module_py_30.py +++ b/test/input/func_deprecated_module_py_30.py @@ -1,12 +1,12 @@ """test deprecated module """ - +from __future__ import print_function __revision__ = 0 if __revision__: import Bastion - print Bastion + print(Bastion) # false positive (#10061) import stringfile - print stringfile + print(stringfile) diff --git a/test/input/func_disable_linebased.py b/test/input/func_disable_linebased.py index fe59fa1..953848b 100644 --- a/test/input/func_disable_linebased.py +++ b/test/input/func_disable_linebased.py @@ -1,5 +1,5 @@ # This is a very very very very very very very very very very very very very very very very very very very very very long line. -# pylint: disable=line-too-long +# pylint: disable=line-too-long, print-statement """Make sure enable/disable pragmas work for messages that are applied to lines and not syntax nodes. A disable pragma for a message that applies to nodes is applied to the whole diff --git a/test/input/func_e0203.py b/test/input/func_e0203.py index d95a8dd..d86f479 100644 --- a/test/input/func_e0203.py +++ b/test/input/func_e0203.py @@ -1,6 +1,6 @@ """check for method without self as first argument """ - +from __future__ import print_function __revision__ = 0 @@ -16,4 +16,4 @@ class Abcd(object): def edf(self): """justo ne more method""" - print 'yapudju in', self + print('yapudju in', self) diff --git a/test/input/func_e0204.py b/test/input/func_e0204.py index 26cbd52..7ab9cff 100644 --- a/test/input/func_e0204.py +++ b/test/input/func_e0204.py @@ -1,6 +1,6 @@ """check for method without self as first argument """ - +from __future__ import print_function __revision__ = 0 @@ -9,11 +9,11 @@ class Abcd(object): def __init__(truc): """method without self""" - print 1 + print(1) def abdc(yoo): """another test""" - print yoo + print(yoo) def edf(self): """just another method""" - print 'yapudju in', self + print('yapudju in', self) diff --git a/test/input/func_e0601.py b/test/input/func_e0601.py index 2b704d5..122ba01 100644 --- a/test/input/func_e0601.py +++ b/test/input/func_e0601.py @@ -1,9 +1,9 @@ """test local variable used before assignment """ - +from __future__ import print_function __revision__ = 0 def function(): """dummy""" - print aaaa + print(aaaa) aaaa = 1 diff --git a/test/input/func_e13xx.py b/test/input/func_e13xx.py index 1eaf598..e2bd77e 100644 --- a/test/input/func_e13xx.py +++ b/test/input/func_e13xx.py @@ -1,6 +1,6 @@ """test string format error """ - +# pylint: disable=print-statement __revision__ = 1 PARG_1 = PARG_2 = PARG_3 = 1 @@ -19,4 +19,3 @@ def pprint(): print "%2z" % PARG_1 print "strange format %2" % PARG_2 print "works in 3 %a" % 1 - diff --git a/test/input/func_f0401.py b/test/input/func_f0401.py index c663431..143c148 100644 --- a/test/input/func_f0401.py +++ b/test/input/func_f0401.py @@ -1,9 +1,9 @@ """test failed import """ - +from __future__ import print_function __revision__ = 0 def function(): """yo""" from tutu import toto - print toto + print(toto) diff --git a/test/input/func_indent.py b/test/input/func_indent.py index 3c6ee41..c593b49 100644 --- a/test/input/func_indent.py +++ b/test/input/func_indent.py @@ -1,3 +1,4 @@ +# pylint: disable=print-statement """docstring""" __revision__ = '$Id: func_indent.py,v 1.4 2003-10-17 21:59:31 syt Exp $' diff --git a/test/input/func_init_vars.py b/test/input/func_init_vars.py index db94475..0cb4773 100644 --- a/test/input/func_init_vars.py +++ b/test/input/func_init_vars.py @@ -1,6 +1,6 @@ """Checks that class variables are seen as inherited ! """ - +# pylint: disable=print-statement __revision__ = '' @@ -43,4 +43,3 @@ class MySubClass(MyClass): if __name__ == '__main__': OBJ = MyClass() OBJ.met() - diff --git a/test/input/func_interfaces.py b/test/input/func_interfaces.py index 9756183..21f42fb 100644 --- a/test/input/func_interfaces.py +++ b/test/input/func_interfaces.py @@ -1,4 +1,4 @@ -# pylint:disable=R0201 +# pylint:disable=R0201, print-statement """docstring""" __revision__ = '' @@ -110,5 +110,3 @@ class EmptyImplements(object): def besilent(self): """public method 2/2""" - - diff --git a/test/input/func_method_could_be_function.py b/test/input/func_method_could_be_function.py index a28e48a..7544793 100644 --- a/test/input/func_method_could_be_function.py +++ b/test/input/func_method_could_be_function.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903,R0922,W0232 +# pylint: disable=R0903,R0922,W0232,print-statement """test detection of method which could be a function""" __revision__ = None diff --git a/test/input/func_module___dict__.py b/test/input/func_module___dict__.py index 0cf1550..5451422 100644 --- a/test/input/func_module___dict__.py +++ b/test/input/func_module___dict__.py @@ -1,9 +1,9 @@ """http://www.logilab.org/ticket/6949.""" - +from __future__ import print_function __revision__ = None -print __dict__ is not None +print(__dict__ is not None) __dict__ = {} -print __dict__ is not None +print(__dict__ is not None) diff --git a/test/input/func_names_imported_from_module.py b/test/input/func_names_imported_from_module.py index 64c8f6c..fb271a5 100644 --- a/test/input/func_names_imported_from_module.py +++ b/test/input/func_names_imported_from_module.py @@ -1,4 +1,4 @@ -#pylint: disable=W0401,W0611 +#pylint: disable=W0401,W0611,print-statement """check unexistant names imported are reported""" __revision__ = None @@ -25,4 +25,3 @@ from re import findiiter, compiile import os 'SOMEVAR' in os.environ - diff --git a/test/input/func_no_dummy_redefined.py b/test/input/func_no_dummy_redefined.py index 8af89d8..7d40f81 100644 --- a/test/input/func_no_dummy_redefined.py +++ b/test/input/func_no_dummy_redefined.py @@ -11,4 +11,4 @@ def clobbering(): """Clobbers a dummy name from the outer scope.""" value = 9 for _ in range(7): - print value + print value # pylint: disable=print-statement diff --git a/test/input/func_noerror_access_attr_before_def_false_positive.py b/test/input/func_noerror_access_attr_before_def_false_positive.py index 7f8bbb4..c721278 100644 --- a/test/input/func_noerror_access_attr_before_def_false_positive.py +++ b/test/input/func_noerror_access_attr_before_def_false_positive.py @@ -1,4 +1,4 @@ -#pylint: disable=C0103,R0904,R0903,W0201,old-style-class +#pylint: disable=C0103,R0904,R0903,W0201,old-style-class,print-statement """ This module demonstrates a possible problem of pyLint with calling __init__ s from inherited classes. diff --git a/test/input/func_noerror_base_init_vars.py b/test/input/func_noerror_base_init_vars.py index 0870cef..d74f040 100644 --- a/test/input/func_noerror_base_init_vars.py +++ b/test/input/func_noerror_base_init_vars.py @@ -1,4 +1,4 @@ -# pylint:disable=R0201 +# pylint:disable=R0201, print-statement """Checks that class variables are seen as inherited ! """ __revision__ = '' @@ -33,4 +33,3 @@ class MyClass(BaseClass): if __name__ == '__main__': OBJ = MyClass() OBJ.met() - diff --git a/test/input/func_noerror_decorator_scope.py b/test/input/func_noerror_decorator_scope.py index 95e7a47..9c84d61 100644 --- a/test/input/func_noerror_decorator_scope.py +++ b/test/input/func_noerror_decorator_scope.py @@ -1,4 +1,4 @@ -# -*- pylint: disable=W0232,R0903 +# -*- pylint: disable=W0232,R0903,print-statement """Test that decorators sees the class namespace - just like function default values does but function body doesn't. diff --git a/test/input/func_noerror_e1101_but_getattr.py b/test/input/func_noerror_e1101_but_getattr.py index 03b8fb9..529b413 100644 --- a/test/input/func_noerror_e1101_but_getattr.py +++ b/test/input/func_noerror_e1101_but_getattr.py @@ -1,5 +1,5 @@ """don't want E1101 if __getattr__ is defined""" - +from __future__ import print_function __revision__ = None class MyString(object): @@ -20,4 +20,4 @@ class MyString(object): return self.string.upper() MYSTRING = MyString("abc") -print MYSTRING.title() +print(MYSTRING.title()) diff --git a/test/input/func_noerror_except_pass.py b/test/input/func_noerror_except_pass.py index a28c4ea..5bb8011 100644 --- a/test/input/func_noerror_except_pass.py +++ b/test/input/func_noerror_except_pass.py @@ -2,10 +2,11 @@ #3205: W0704 (except doesn't do anything) false positive if some statements follow a "pass" """ +from __future__ import print_function __revision__ = None try: A = 2 except ValueError: pass # pylint: disable=W0107 - print A + print(A) diff --git a/test/input/func_noerror_factory_method.py b/test/input/func_noerror_factory_method.py index 80ad433..a7cff43 100644 --- a/test/input/func_noerror_factory_method.py +++ b/test/input/func_noerror_factory_method.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903 +# pylint: disable=R0903, print-statement """use new astroid context sensitive inference""" __revision__ = 1 diff --git a/test/input/func_noerror_function_as_method.py b/test/input/func_noerror_function_as_method.py index 6d96a65..e59fb5c 100644 --- a/test/input/func_noerror_function_as_method.py +++ b/test/input/func_noerror_function_as_method.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903 +# pylint: disable=R0903, print-statement '''Test that a function is considered a method when looked up through a class. ''' __revision__ = 1 diff --git a/test/input/func_noerror_lambda_use_before_assign.py b/test/input/func_noerror_lambda_use_before_assign.py index 0ab8c2c..af2775c 100644 --- a/test/input/func_noerror_lambda_use_before_assign.py +++ b/test/input/func_noerror_lambda_use_before_assign.py @@ -1,7 +1,8 @@ """https://www.logilab.net/elo/ticket/18862""" +from __future__ import print_function __revision__ = 1 def function(): """hop""" ggg = lambda: xxx xxx = 1 - print ggg() + print(ggg()) diff --git a/test/input/func_noerror_mcs_attr_access.py b/test/input/func_noerror_mcs_attr_access.py index 8556f8f..ba3ee32 100644 --- a/test/input/func_noerror_mcs_attr_access.py +++ b/test/input/func_noerror_mcs_attr_access.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903 +# pylint: disable=R0903, print-statement """test attribute access on metaclass""" diff --git a/test/input/func_noerror_nested_classes.py b/test/input/func_noerror_nested_classes.py index 0996c66..56e57bb 100644 --- a/test/input/func_noerror_nested_classes.py +++ b/test/input/func_noerror_nested_classes.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903 +# pylint: disable=R0903, print-statement """crash test""" __revision__ = 1 diff --git a/test/input/func_noerror_new_style_class_py_30.py b/test/input/func_noerror_new_style_class_py_30.py index 1121196..a33ae19 100644 --- a/test/input/func_noerror_new_style_class_py_30.py +++ b/test/input/func_noerror_new_style_class_py_30.py @@ -3,7 +3,7 @@ on a file are correctly handled bug notified by Pierre Rouleau on 2005-04-24 """ - +from __future__ import print_function __revision__ = None class File(file): # pylint: disable=file-builtin @@ -17,8 +17,8 @@ class File(file): # pylint: disable=file-builtin self.verbose = verbose super(File, self).__init__(name, mode, buffering) if self.verbose: - print "File %s is opened. The mode is: %s" % (self.name, - self.mode) + print("File %s is opened. The mode is: %s" % (self.name, + self.mode)) # def write(self, a_string): @@ -39,7 +39,7 @@ class File(file): # pylint: disable=file-builtin """Close the file.""" if self.verbose: - print "Closing file %s" % self.name + print("Closing file %s" % self.name) super(File, self).close() self.was_modified = False diff --git a/test/input/func_noerror_no_warning_docstring.py b/test/input/func_noerror_no_warning_docstring.py index 1af00c2..5af0bf8 100644 --- a/test/input/func_noerror_no_warning_docstring.py +++ b/test/input/func_noerror_no_warning_docstring.py @@ -1,5 +1,5 @@ ''' Test for inheritence ''' - +from __future__ import print_function __revision__ = 1 class AAAA(object): @@ -10,11 +10,11 @@ class AAAA(object): def method1(self): ''' method 1 ''' - print self + print(self) def method2(self): ''' method 2 ''' - print self + print(self) class BBBB(AAAA): ''' class BBBB ''' diff --git a/test/input/func_noerror_overloaded_operator.py b/test/input/func_noerror_overloaded_operator.py index a013673..4e29946 100644 --- a/test/input/func_noerror_overloaded_operator.py +++ b/test/input/func_noerror_overloaded_operator.py @@ -1,4 +1,4 @@ -# pylint: disable=C0111,R0903 +# pylint: disable=C0111,R0903,print-statement """#3291""" __revision__ = 1 diff --git a/test/input/func_noerror_static_method.py b/test/input/func_noerror_static_method.py index ea5f7d8..ef21cb9 100644 --- a/test/input/func_noerror_static_method.py +++ b/test/input/func_noerror_static_method.py @@ -1,6 +1,6 @@ """Checks if static / class methods works fine in Pylint """ - +from __future__ import print_function __revision__ = '' class MyClass(object): @@ -12,12 +12,12 @@ class MyClass(object): def static_met(var1, var2): """This is a static method """ - print var1, var2 + print(var1, var2) def class_met(cls, var1): """This is a class method """ - print cls, var1 + print(cls, var1) static_met = staticmethod(static_met) class_met = classmethod(class_met) diff --git a/test/input/func_noerror_staticmethod_as_decorator_py24.py b/test/input/func_noerror_staticmethod_as_decorator_py24.py index d671879..7884cbd 100644 --- a/test/input/func_noerror_staticmethod_as_decorator_py24.py +++ b/test/input/func_noerror_staticmethod_as_decorator_py24.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903 +# pylint: disable=R0903, print-statement """test staticmethod and classmethod as decorator""" __revision__ = None @@ -31,5 +31,3 @@ class ClassMethod2(object): def do_work_with_arg(cls, job): "Working on something" print "Working on %s..." % job - - diff --git a/test/input/func_noerror_super_protected.py b/test/input/func_noerror_super_protected.py index 5e78eea..b0961be 100644 --- a/test/input/func_noerror_super_protected.py +++ b/test/input/func_noerror_super_protected.py @@ -1,6 +1,6 @@ """Accessing a protected method through super() is ok.""" -# pylint: disable=missing-docstring,too-few-public-methods +# pylint: disable=missing-docstring,too-few-public-methods, print-statement __revision__ = None diff --git a/test/input/func_noerror_used_before_assignment.py b/test/input/func_noerror_used_before_assignment.py index 6ba0b88..844ee05 100644 --- a/test/input/func_noerror_used_before_assignment.py +++ b/test/input/func_noerror_used_before_assignment.py @@ -1,4 +1,4 @@ -# pylint: disable = line-too-long, multiple-statements, missing-module-attribute +# pylint: disable = line-too-long, multiple-statements, missing-module-attribute, print-statement """https://bitbucket.org/logilab/pylint/issue/111/false-positive-used-before-assignment-with""" try: raise IOError(1, "a") diff --git a/test/input/func_noerror_yield_assign_py25.py b/test/input/func_noerror_yield_assign_py25.py index 5c365e2..011634b 100644 --- a/test/input/func_noerror_yield_assign_py25.py +++ b/test/input/func_noerror_yield_assign_py25.py @@ -1,5 +1,5 @@ """http://www.logilab.org/ticket/8771""" - +# pylint: disable=print-statement __revision__ = 2 def generator(): diff --git a/test/input/func_r0903.py b/test/input/func_r0903.py index ccbad58..917b0ea 100644 --- a/test/input/func_r0903.py +++ b/test/input/func_r0903.py @@ -1,4 +1,5 @@ """test min methods""" +from __future__ import print_function __revision__ = None class Aaaa(object): @@ -7,7 +8,7 @@ class Aaaa(object): pass def meth1(self): """hehehe""" - print self + print(self) def _dontcount(self): """not public""" - print self + print(self) diff --git a/test/input/func_set_literal_as_default_py27.py b/test/input/func_set_literal_as_default_py27.py index 5c7200e..1bd3f7e 100644 --- a/test/input/func_set_literal_as_default_py27.py +++ b/test/input/func_set_literal_as_default_py27.py @@ -1,7 +1,7 @@ """docstring""" - +from __future__ import print_function __revision__ = '' def function1(value={1}): """set is mutable and dangerous.""" - print value + print(value) diff --git a/test/input/func_trailing_whitespace.py b/test/input/func_trailing_whitespace.py index aca4a2f..946d748 100644 --- a/test/input/func_trailing_whitespace.py +++ b/test/input/func_trailing_whitespace.py @@ -1,5 +1,5 @@ """Regression test for trailing-whitespace (C0303).""" -# pylint: disable=mixed-line-endings +# pylint: disable=mixed-line-endings, print-statement __revision__ = 0 print 'some trailing whitespace' diff --git a/test/input/func_typecheck_callfunc_assigment.py b/test/input/func_typecheck_callfunc_assigment.py index 838b27c..3a668ab 100644 --- a/test/input/func_typecheck_callfunc_assigment.py +++ b/test/input/func_typecheck_callfunc_assigment.py @@ -1,4 +1,4 @@ -# pylint: disable=R0921 +# pylint: disable=R0921, print-statement """check assignment to function call where the function doesn't return 'E1111': ('Assigning to function call which doesn\'t return', diff --git a/test/input/func_unreachable.py b/test/input/func_unreachable.py index c5f7eec..4034e4f 100644 --- a/test/input/func_unreachable.py +++ b/test/input/func_unreachable.py @@ -1,22 +1,21 @@ """docstring""" - +from __future__ import print_function __revision__ = '' def func1(): """docstring""" return 1 - print 'unreachable' + print('unreachable') def func2(): """docstring""" while 1: break - print 'unreachable' + print('unreachable') def func3(): """docstring""" for i in (1, 2, 3): - print i + print(i) continue - print 'unreachable' - + print('unreachable') diff --git a/test/input/func_unused_overridden_argument.py b/test/input/func_unused_overridden_argument.py index b587a12..85430d4 100644 --- a/test/input/func_unused_overridden_argument.py +++ b/test/input/func_unused_overridden_argument.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903 +# pylint: disable=R0903, print-statement """for Sub.inherited, only the warning for "aay" is desired. The warnings for "aab" and "aac" are most likely false positives though, because there could be another subclass that overrides the same method and does @@ -29,4 +29,3 @@ class Sub2(Base): def inherited(self, aaa, aab, aac): "overridden method, use every argument" return aaa + aab + aac - diff --git a/test/input/func_use_for_or_listcomp_var.py b/test/input/func_use_for_or_listcomp_var.py index 3de5a72..5690a2c 100644 --- a/test/input/func_use_for_or_listcomp_var.py +++ b/test/input/func_use_for_or_listcomp_var.py @@ -1,5 +1,5 @@ """test a warning is triggered when using for a lists comprehension variable""" - +# pylint: disable=print-statement __revision__ = 'yo' TEST_LC = [C for C in __revision__ if C.isalpha()] diff --git a/test/input/func_w0103.py b/test/input/func_w0103.py index f8216d9..04cb4c1 100644 --- a/test/input/func_w0103.py +++ b/test/input/func_w0103.py @@ -1,8 +1,8 @@ """test max branch """ - +from __future__ import print_function __revision__ = '' def stupid_function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9): """reallly stupid function""" - print arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 + print(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) diff --git a/test/input/func_w0104.py b/test/input/func_w0104.py index d601682..6588e98 100644 --- a/test/input/func_w0104.py +++ b/test/input/func_w0104.py @@ -1,6 +1,6 @@ """test max branch """ - +# pylint: disable=print-statement __revision__ = '' def stupid_function(arg1, arg2, arg3, arg4, arg5): diff --git a/test/input/func_w0105.py b/test/input/func_w0105.py index c951e9d..c40870e 100644 --- a/test/input/func_w0105.py +++ b/test/input/func_w0105.py @@ -1,6 +1,6 @@ """test max branch """ - +# pylint: disable=print-statement __revision__ = '' def stupid_function(arg): diff --git a/test/input/func_w0112.py b/test/input/func_w0112.py index cdf2bd0..6bddf00 100644 --- a/test/input/func_w0112.py +++ b/test/input/func_w0112.py @@ -1,6 +1,6 @@ """test max branch """ - +# pylint: disable=print-statement __revision__ = '' def stupid_function(arg): diff --git a/test/input/func_w0205.py b/test/input/func_w0205.py index 6e7bf43..97db817 100644 --- a/test/input/func_w0205.py +++ b/test/input/func_w0205.py @@ -1,5 +1,5 @@ """check different signatures""" - +from __future__ import print_function __revision__ = 0 class Abcd(object): @@ -8,7 +8,7 @@ class Abcd(object): self.aarg = False def abcd(self, aaa=1, bbbb=None): """hehehe""" - print self, aaa, bbbb + print(self, aaa, bbbb) def args(self): """gaarrrggll""" self.aarg = True @@ -21,4 +21,4 @@ class Cdef(Abcd): def abcd(self, aaa, bbbb=None): """hehehe""" - print self, aaa, bbbb + print(self, aaa, bbbb) diff --git a/test/input/func_w0223.py b/test/input/func_w0223.py index 1563b41..5d380cc 100644 --- a/test/input/func_w0223.py +++ b/test/input/func_w0223.py @@ -1,7 +1,7 @@ # pylint: disable=R0903,R0922 """test overriding of abstract method """ - +from __future__ import print_function __revision__ = '$Id: func_w0223.py,v 1.2 2004-09-29 08:35:13 syt Exp $' class Abstract(object): @@ -33,4 +33,4 @@ class Concret(Abstract): def aaaa(self): """overidden form Abstract""" - print self + print(self) diff --git a/test/input/func_w0231.py b/test/input/func_w0231.py index 7c4cc02..eeefd0c 100644 --- a/test/input/func_w0231.py +++ b/test/input/func_w0231.py @@ -1,20 +1,20 @@ # pylint: disable=R0903 """test for __init__ not called """ - +from __future__ import print_function __revision__ = '$Id: func_w0231.py,v 1.3 2004-09-29 08:35:13 syt Exp $' class AAAA: """ancestor 1""" def __init__(self): - print 'init', self + print('init', self) class BBBB: """ancestor 2""" def __init__(self): - print 'init', self + print('init', self) class CCCC: """ancestor 3""" @@ -30,7 +30,7 @@ class NewStyleA(object): """new style class""" def __init__(self): super(NewStyleA, self).__init__() - print 'init', self + print('init', self) class NewStyleB(NewStyleA): """derived new style class""" diff --git a/test/input/func_w0233.py b/test/input/func_w0233.py index ef5f205..4dbf26f 100644 --- a/test/input/func_w0233.py +++ b/test/input/func_w0233.py @@ -1,21 +1,21 @@ # pylint: disable=R0903,W0212,W0403,W0406 """test for call to __init__ from a non ancestor class """ - +from __future__ import print_function __revision__ = '$Id: func_w0233.py,v 1.2 2004-09-29 08:35:13 syt Exp $' class AAAA(object): """ancestor 1""" def __init__(self): - print 'init', self + print('init', self) BBBBMixin.__init__(self) class BBBBMixin(object): """ancestor 2""" def __init__(self): - print 'init', self + print('init', self) import nonexistant import func_w0233 diff --git a/test/input/func_w0312.py b/test/input/func_w0312.py index 06a8110..491f75b 100644 --- a/test/input/func_w0312.py +++ b/test/input/func_w0312.py @@ -1,11 +1,11 @@ """test mixed tabs and spaces""" - +from __future__ import print_function __revision__ = 1 def spaces_func(): """yo""" - print "yo" + print("yo") def tab_func(): """yo""" - print "yo" + print("yo") diff --git a/test/input/func_w0401.py b/test/input/func_w0401.py index 160b555..25ca7b8 100644 --- a/test/input/func_w0401.py +++ b/test/input/func_w0401.py @@ -1,5 +1,6 @@ """test cyclic import """ +# pylint: disable=print-statement __revision__ = 0 from input import w0401_cycle diff --git a/test/input/func_w0404.py b/test/input/func_w0404.py index f475a4d..bc0dbed 100644 --- a/test/input/func_w0404.py +++ b/test/input/func_w0404.py @@ -1,5 +1,5 @@ """Unittests for W0404 (reimport)""" - +from __future__ import print_function __revision__ = 0 import sys @@ -15,7 +15,7 @@ import sys def no_reimport(): """docstring""" import os - print os + print(os) def reimport(): diff --git a/test/input/func_w0405.py b/test/input/func_w0405.py index 8b96cd9..8d7f8b1 100644 --- a/test/input/func_w0405.py +++ b/test/input/func_w0405.py @@ -1,6 +1,6 @@ """check reimport """ - +from __future__ import print_function __revision__ = 0 import os @@ -12,9 +12,9 @@ import re as _re _re.match('yo', '.*') if __revision__: - print os + print(os) from os.path import exists - print join, exists + print(join, exists) def func(yooo): """reimport in different scope""" @@ -25,7 +25,7 @@ def func(yooo): if 1: import sys - print sys.modules + print(sys.modules) else: - print 'bla' + print('bla') import sys diff --git a/test/input/func_w0406.py b/test/input/func_w0406.py index e20508f..3bb0fef 100644 --- a/test/input/func_w0406.py +++ b/test/input/func_w0406.py @@ -1,9 +1,9 @@ """test module importing itself """ +from __future__ import print_function __revision__ = 0 import func_w0406 if __revision__: - print func_w0406 - + print(func_w0406) diff --git a/test/input/func_w0611.py b/test/input/func_w0611.py index 6bef753..57e7238 100644 --- a/test/input/func_w0611.py +++ b/test/input/func_w0611.py @@ -1,6 +1,9 @@ """check unused import """ +# pylint: disable=print-statement + __revision__ = 1 + import os import sys diff --git a/test/input/func_w0612.py b/test/input/func_w0612.py index e871bb2..8c8a8b2 100644 --- a/test/input/func_w0612.py +++ b/test/input/func_w0612.py @@ -1,6 +1,6 @@ """test unused variable """ -# pylint: disable=invalid-name, redefined-outer-name +# pylint: disable=invalid-name, redefined-outer-name, print-statement __revision__ = 0 PATH = OS = collections = deque = None @@ -35,4 +35,3 @@ def test_global(): from sys import version as VERSION import this import re as RE - diff --git a/test/input/func_w0613.py b/test/input/func_w0613.py index 1df71dd..333699c 100644 --- a/test/input/func_w0613.py +++ b/test/input/func_w0613.py @@ -1,4 +1,4 @@ -# pylint: disable=R0903 +# pylint: disable=R0903, print-statement """test unused argument """ @@ -40,4 +40,3 @@ class BBBB(object): def __init__(self, arg): """Constructor with an extra parameter. Should raise a warning""" self.spam = 1 - diff --git a/test/input/func_w0623_py_30.py b/test/input/func_w0623_py_30.py index 8f1f34c..539c0b1 100644 --- a/test/input/func_w0623_py_30.py +++ b/test/input/func_w0623_py_30.py @@ -1,5 +1,5 @@ """Test for W0623, overwriting names in exception handlers.""" -# pylint: disable=broad-except,bare-except,pointless-except +# pylint: disable=broad-except,bare-except,pointless-except,print-statement __revision__ = '' import exceptions diff --git a/test/input/func_w0631.py b/test/input/func_w0631.py index 2524f5e..0390ac7 100644 --- a/test/input/func_w0631.py +++ b/test/input/func_w0631.py @@ -1,13 +1,13 @@ """Check possible undefined loopvar """ - +from __future__ import print_function __revision__ = 0 def do_stuff(some_random_list): """This is not right.""" for var in some_random_list: pass - print var + print(var) def do_else(some_random_list): @@ -17,5 +17,4 @@ def do_else(some_random_list): break else: var = 84 - print var - + print(var) diff --git a/test/input/func_w0702.py b/test/input/func_w0702.py index 38a6417..1f82a23 100644 --- a/test/input/func_w0702.py +++ b/test/input/func_w0702.py @@ -1,17 +1,17 @@ """check empty except statement """ - +from __future__ import print_function __revision__ = 0 if __revision__: try: - print __revision__ + print(__revision__) except: - print 'error' + print('error') try: __revision__ += 1 except TypeError: - print 'error' + print('error') except Exception: - print 'error' + print('error') diff --git a/test/input/func_w0703.py b/test/input/func_w0703.py index 4040540..fb633fd 100644 --- a/test/input/func_w0703.py +++ b/test/input/func_w0703.py @@ -1,9 +1,9 @@ """check empty except statement """ - +from __future__ import print_function __revision__ = 0 try: __revision__ += 1 except Exception: - print 'error' + print('error') diff --git a/test/input/func_with_without_as_py25.py b/test/input/func_with_without_as_py25.py index e3b2c71..7ecf574 100644 --- a/test/input/func_with_without_as_py25.py +++ b/test/input/func_with_without_as_py25.py @@ -1,14 +1,12 @@ '''This is a little non regression test on a with statement without 'as'. ''' -from __future__ import with_statement +from __future__ import with_statement, print_function __revision__ = 32321313 def do_nothing(arg): 'ho foo' - print arg + print(arg) with open('x'): base.baz base = 7 - - diff --git a/test/input/w0401_cycle.py b/test/input/w0401_cycle.py index bf731e0..7d8fa99 100644 --- a/test/input/w0401_cycle.py +++ b/test/input/w0401_cycle.py @@ -1,6 +1,6 @@ """w0401 dependency """ - +# pylint: disable=print-statement __revision__ = 0 import input.func_w0401 |