Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Jan 28, 2022
1 parent 9329b8e commit 76a7a9b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 44 deletions.
51 changes: 21 additions & 30 deletions tests/data/trailing_comma_optional_parens1.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,37 @@ def b(self):

# output

if (
e1234123412341234.winerror
not in (
_winapi.ERROR_SEM_TIMEOUT,
_winapi.ERROR_PIPE_BUSY,
)
or _check_timeout(t)
):
if e1234123412341234.winerror not in (
_winapi.ERROR_SEM_TIMEOUT,
_winapi.ERROR_PIPE_BUSY,
) or _check_timeout(t):
pass

if x:
if y:
new_id = max(
Vegetable.objects.order_by("-id")[0].id,
Mineral.objects.order_by("-id")[0].id
) + 1
new_id = (
max(
Vegetable.objects.order_by("-id")[0].id,
Mineral.objects.order_by("-id")[0].id,
)
+ 1
)


class X:
def get_help_text(self):
return (
ngettext(
"Your password must contain at least %(min_length)d character.",
"Your password must contain at least %(min_length)d characters.",
self.min_length,
)
% {"min_length": self.min_length}
)
return ngettext(
"Your password must contain at least %(min_length)d character.",
"Your password must contain at least %(min_length)d characters.",
self.min_length,
) % {"min_length": self.min_length}


class A:
def b(self):
if (
self.connection.mysql_is_mariadb
and (
10,
4,
3,
)
< self.connection.mysql_version
< (10, 5, 2)
):
if self.connection.mysql_is_mariadb and (
10,
4,
3,
) < self.connection.mysql_version < (10, 5, 2):
pass
15 changes: 5 additions & 10 deletions tests/data/trailing_comma_optional_parens2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@

# output

if (
e123456.get_tk_patchlevel() >= (8, 6, 0, "final")
or (
8,
5,
8,
)
<= get_tk_patchlevel()
< (8, 6)
):
if e123456.get_tk_patchlevel() >= (8, 6, 0, "final") or (
8,
5,
8,
) <= get_tk_patchlevel() < (8, 6):
pass
5 changes: 1 addition & 4 deletions tests/data/trailing_comma_optional_parens3.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@
"qweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweas "
+ "qweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqwegqweasdzxcqweasdzxc.",
"qweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqwe",
) % {
"reported_username": reported_username,
"report_reason": report_reason,
}
) % {"reported_username": reported_username, "report_reason": report_reason}

0 comments on commit 76a7a9b

Please sign in to comment.