Skip to content

Commit

Permalink
Update implicit optional tests for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Jul 12, 2023
1 parent 2ef8500 commit 8955ef9
Show file tree
Hide file tree
Showing 2 changed files with 241 additions and 189 deletions.
16 changes: 16 additions & 0 deletions crates/ruff/resources/test/fixtures/ruff/RUF013_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def f(arg: typing.Optional[int] = None):
# Union


def f(arg: Union[None] = None):
pass


def f(arg: Union[None, int] = None):
pass

Expand All @@ -68,6 +72,10 @@ def f(arg: Union = None): # RUF013
pass


def f(arg: Union[int] = None): # RUF013
pass


def f(arg: Union[int, str] = None): # RUF013
pass

Expand Down Expand Up @@ -106,10 +114,18 @@ def f(arg: None = None):
pass


def f(arg: Literal[None] = None):
pass


def f(arg: Literal[1, 2, None, 3] = None):
pass


def f(arg: Literal[1] = None): # RUF013
pass


def f(arg: Literal[1, "foo"] = None): # RUF013
pass

Expand Down
Loading

0 comments on commit 8955ef9

Please sign in to comment.