Skip to content

Commit

Permalink
test: added tests for functions with whitespaces in def nedbat#684
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekgyver authored and nedbat committed Dec 2, 2023
1 parent fdb6841 commit cec888f
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tests/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,56 @@ def my_func_2(super_long_input_argument_0=0, super_long_input_argument_1=1, supe
""",
[1,5], "5", excludes=['my_func_2'])

self.check_coverage("""\
def my_func (
super_long_input_argument_0=0,
super_long_input_argument_1=1,
super_long_input_argument_2=2):
pass
def my_func_2 (super_long_input_argument_0=0, super_long_input_argument_1=1, super_long_input_argument_2=2):
pass
""",
[1,5], "5", excludes=['my_func_2'])

self.check_coverage("""\
def my_func (
super_long_input_argument_0=0,
super_long_input_argument_1=1,
super_long_input_argument_2=2):
pass
def my_func_2 (super_long_input_argument_0=0, super_long_input_argument_1=1, super_long_input_argument_2=2):
pass
""",
[], "5", excludes=['my_func'])

self.check_coverage("""\
def my_func \
(
super_long_input_argument_0=0,
super_long_input_argument_1=1
):
pass
def my_func_2(super_long_input_argument_0=0, super_long_input_argument_1=1, super_long_input_argument_2=2):
pass
""",
[1,5], "5", excludes=['my_func_2'])

self.check_coverage("""\
def my_func \
(
super_long_input_argument_0=0,
super_long_input_argument_1=1
):
pass
def my_func_2(super_long_input_argument_0=0, super_long_input_argument_1=1, super_long_input_argument_2=2):
pass
""",
[], "5", excludes=['my_func'])

def test_excluding_method(self) -> None:
self.check_coverage("""\
class Fooey:
Expand Down

0 comments on commit cec888f

Please sign in to comment.