From b959ce54dfe5749e7da0fe79fbe205d64255b966 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 22 Aug 2021 15:43:39 +0200 Subject: Fix typo in assigment_from_no_return functional tests --- .../a/assign/assigment_from_no_return.py | 61 ---------------------- .../a/assign/assigment_from_no_return.txt | 3 -- .../a/assign/assignment_from_no_return_2.py | 61 ++++++++++++++++++++++ .../a/assign/assignment_from_no_return_2.txt | 3 ++ 4 files changed, 64 insertions(+), 64 deletions(-) delete mode 100644 tests/functional/a/assign/assigment_from_no_return.py delete mode 100644 tests/functional/a/assign/assigment_from_no_return.txt create mode 100644 tests/functional/a/assign/assignment_from_no_return_2.py create mode 100644 tests/functional/a/assign/assignment_from_no_return_2.txt diff --git a/tests/functional/a/assign/assigment_from_no_return.py b/tests/functional/a/assign/assigment_from_no_return.py deleted file mode 100644 index 4cd5ef106..000000000 --- a/tests/functional/a/assign/assigment_from_no_return.py +++ /dev/null @@ -1,61 +0,0 @@ -# pylint: disable=useless-return, useless-object-inheritance, condition-evals-to-constant -"""check assignment to function call where the function doesn't return - - 'E1111': ('Assigning to function call which doesn\'t return', - 'Used when an assignment is done on a function call but the \ - infered function doesn\'t return anything.'), - 'W1111': ('Assigning to function call which only returns None', - 'Used when an assignment is done on a function call but the \ - infered function returns nothing but None.'), - -""" -from __future__ import generators, print_function - -def func_no_return(): - """function without return""" - print('dougloup') - -A = func_no_return() # [assignment-from-no-return] - - -def func_return_none(): - """function returning none""" - print('dougloup') - return None - -A = func_return_none() # [assignment-from-none] - - -def func_implicit_return_none(): - """Function returning None from bare return statement.""" - return - -A = func_implicit_return_none() # [assignment-from-none] - - -def func_return_none_and_smth(): - """function returning none and something else""" - print('dougloup') - if 2 or 3: - return None - return 3 - -A = func_return_none_and_smth() - -def generator(): - """no problemo""" - yield 2 - -A = generator() - -class Abstract(object): - """bla bla""" - - def abstract_method(self): - """use to return something in concrete implementation""" - raise NotImplementedError - - def use_abstract(self): - """should not issue E1111""" - var = self.abstract_method() - print(var) diff --git a/tests/functional/a/assign/assigment_from_no_return.txt b/tests/functional/a/assign/assigment_from_no_return.txt deleted file mode 100644 index 4518109ac..000000000 --- a/tests/functional/a/assign/assigment_from_no_return.txt +++ /dev/null @@ -1,3 +0,0 @@ -assignment-from-no-return:18:0::Assigning result of a function call, where the function has no return -assignment-from-none:26:0::Assigning result of a function call, where the function returns None -assignment-from-none:33:0::Assigning result of a function call, where the function returns None diff --git a/tests/functional/a/assign/assignment_from_no_return_2.py b/tests/functional/a/assign/assignment_from_no_return_2.py new file mode 100644 index 000000000..4cd5ef106 --- /dev/null +++ b/tests/functional/a/assign/assignment_from_no_return_2.py @@ -0,0 +1,61 @@ +# pylint: disable=useless-return, useless-object-inheritance, condition-evals-to-constant +"""check assignment to function call where the function doesn't return + + 'E1111': ('Assigning to function call which doesn\'t return', + 'Used when an assignment is done on a function call but the \ + infered function doesn\'t return anything.'), + 'W1111': ('Assigning to function call which only returns None', + 'Used when an assignment is done on a function call but the \ + infered function returns nothing but None.'), + +""" +from __future__ import generators, print_function + +def func_no_return(): + """function without return""" + print('dougloup') + +A = func_no_return() # [assignment-from-no-return] + + +def func_return_none(): + """function returning none""" + print('dougloup') + return None + +A = func_return_none() # [assignment-from-none] + + +def func_implicit_return_none(): + """Function returning None from bare return statement.""" + return + +A = func_implicit_return_none() # [assignment-from-none] + + +def func_return_none_and_smth(): + """function returning none and something else""" + print('dougloup') + if 2 or 3: + return None + return 3 + +A = func_return_none_and_smth() + +def generator(): + """no problemo""" + yield 2 + +A = generator() + +class Abstract(object): + """bla bla""" + + def abstract_method(self): + """use to return something in concrete implementation""" + raise NotImplementedError + + def use_abstract(self): + """should not issue E1111""" + var = self.abstract_method() + print(var) diff --git a/tests/functional/a/assign/assignment_from_no_return_2.txt b/tests/functional/a/assign/assignment_from_no_return_2.txt new file mode 100644 index 000000000..4518109ac --- /dev/null +++ b/tests/functional/a/assign/assignment_from_no_return_2.txt @@ -0,0 +1,3 @@ +assignment-from-no-return:18:0::Assigning result of a function call, where the function has no return +assignment-from-none:26:0::Assigning result of a function call, where the function returns None +assignment-from-none:33:0::Assigning result of a function call, where the function returns None -- cgit v1.2.1