Skip to content

Commit

Permalink
Add test cases for minor coverage gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
sco1 committed Sep 6, 2020
1 parent 294d1e3 commit 03683bc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (`<ma
## [v2.4.0]
### Fixed
* #92 Fix inconsistent linting behavior between function-level type comments and their equivalent PEP 3107-style function annotations of class methods and classmethods.
* #94 Fix improper handling of the closing definition in a series of `typing.overload` decorated functions.

## [v2.3.0]
### Added
Expand Down
13 changes: 13 additions & 0 deletions testing/test_cases/type_comment_arg_injection_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ def bar(cls, a):
),
should_yield_ANN100=True,
),
"untyped_staticmethod": TypeCommentArgInjectTestCase(
src=dedent(
"""\
class Foo:
@staticmethod
def bar(a):
# type: (...) -> float
...
"""
),
should_yield_ANN100=False,
),
"typed_self_arg": TypeCommentArgInjectTestCase(
src=dedent(
"""\
Expand Down
14 changes: 14 additions & 0 deletions testing/test_cases/type_comment_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ def foo(arg1, arg2):
],
should_yield_ANN301=False,
),
"no_arg_comment": ParserTestCase(
src=dedent(
"""\
def foo(arg1):
# type: (...) -> int
pass
"""
),
args=[
untyped_arg(argname="arg1"),
typed_arg(argname="return", annotation_type=AnnotationType.RETURN),
],
should_yield_ANN301=False,
),
"partial_function_comment_no_ellipsis": ParserTestCase(
src=dedent(
"""\
Expand Down

0 comments on commit 03683bc

Please sign in to comment.