Remove unused whitespaces in test cases (#21806)

These aren't used in the tests themselves. There are more instances of
them in other files but those require code changes so I've left them as
it is.
This commit is contained in:
Dhruv Manilawala 2025-12-05 12:51:40 +05:30 committed by GitHub
parent 1951f1bbb8
commit 6f03afe318
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 39 additions and 39 deletions

View File

@ -230,7 +230,7 @@ calc = Calculator()
" "
def test(): def test():
# Cursor on a position with no symbol # Cursor on a position with no symbol
<CURSOR> <CURSOR>
", ",
); );

View File

@ -824,12 +824,12 @@ mod tests {
Check out this great example code:: Check out this great example code::
x_y = "hello" x_y = "hello"
if len(x_y) > 4: if len(x_y) > 4:
print(x_y) print(x_y)
else: else:
print("too short :(") print("too short :(")
print("done") print("done")
You love to see it. You love to see it.
@ -862,12 +862,12 @@ mod tests {
Check out this great example code :: Check out this great example code ::
x_y = "hello" x_y = "hello"
if len(x_y) > 4: if len(x_y) > 4:
print(x_y) print(x_y)
else: else:
print("too short :(") print("too short :(")
print("done") print("done")
You love to see it. You love to see it.
@ -901,12 +901,12 @@ mod tests {
:: ::
x_y = "hello" x_y = "hello"
if len(x_y) > 4: if len(x_y) > 4:
print(x_y) print(x_y)
else: else:
print("too short :(") print("too short :(")
print("done") print("done")
You love to see it. You love to see it.
@ -939,12 +939,12 @@ mod tests {
let docstring = r#" let docstring = r#"
Check out this great example code:: Check out this great example code::
x_y = "hello" x_y = "hello"
if len(x_y) > 4: if len(x_y) > 4:
print(x_y) print(x_y)
else: else:
print("too short :(") print("too short :(")
print("done") print("done")
You love to see it. You love to see it.
"#; "#;
@ -975,12 +975,12 @@ mod tests {
Check out this great example code:: Check out this great example code::
x_y = "hello" x_y = "hello"
if len(x_y) > 4: if len(x_y) > 4:
print(x_y) print(x_y)
else: else:
print("too short :(") print("too short :(")
print("done")"#; print("done")"#;
let docstring = Docstring::new(docstring.to_owned()); let docstring = Docstring::new(docstring.to_owned());

View File

@ -273,7 +273,7 @@ mod tests {
r#" r#"
class A: class A:
x = 1 x = 1
def method(self): def method(self):
def inner(): def inner():
return <CURSOR>x # Should NOT find class variable x return <CURSOR>x # Should NOT find class variable x
@ -1255,12 +1255,12 @@ x: i<CURSOR>nt = 42
r#" r#"
def outer(): def outer():
x = "outer_value" x = "outer_value"
def inner(): def inner():
nonlocal x nonlocal x
x = "modified" x = "modified"
return x<CURSOR> # Should find the nonlocal x declaration in outer scope return x<CURSOR> # Should find the nonlocal x declaration in outer scope
return inner return inner
"#, "#,
); );
@ -1295,12 +1295,12 @@ def outer():
r#" r#"
def outer(): def outer():
xy = "outer_value" xy = "outer_value"
def inner(): def inner():
nonlocal x<CURSOR>y nonlocal x<CURSOR>y
xy = "modified" xy = "modified"
return x # Should find the nonlocal x declaration in outer scope return x # Should find the nonlocal x declaration in outer scope
return inner return inner
"#, "#,
); );
@ -1636,7 +1636,7 @@ def function():
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, button=a<CURSOR>b): case Click(x, button=a<CURSOR>b):
@ -1675,7 +1675,7 @@ def function():
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, button=ab): case Click(x, button=ab):
@ -1713,7 +1713,7 @@ def function():
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Cl<CURSOR>ick(x, button=ab): case Cl<CURSOR>ick(x, button=ab):
@ -1751,7 +1751,7 @@ def function():
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, but<CURSOR>ton=ab): case Click(x, but<CURSOR>ton=ab):
@ -1919,7 +1919,7 @@ def function():
class C: class C:
def __init__(self): def __init__(self):
self._value = 0 self._value = 0
@property @property
def value(self): def value(self):
return self._value return self._value
@ -2029,7 +2029,7 @@ def function():
r#" r#"
class MyClass: class MyClass:
ClassType = int ClassType = int
def generic_method[T](self, value: Class<CURSOR>Type) -> T: def generic_method[T](self, value: Class<CURSOR>Type) -> T:
return value return value
"#, "#,

View File

@ -1111,7 +1111,7 @@ mod tests {
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, button=a<CURSOR>b): case Click(x, button=a<CURSOR>b):
@ -1131,7 +1131,7 @@ mod tests {
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, button=ab): case Click(x, button=ab):
@ -1151,7 +1151,7 @@ mod tests {
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Cl<CURSOR>ick(x, button=ab): case Cl<CURSOR>ick(x, button=ab):
@ -1189,7 +1189,7 @@ mod tests {
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, but<CURSOR>ton=ab): case Click(x, but<CURSOR>ton=ab):
@ -1398,12 +1398,12 @@ f(**kwargs<CURSOR>)
r#" r#"
def outer(): def outer():
x = "outer_value" x = "outer_value"
def inner(): def inner():
nonlocal x nonlocal x
x = "modified" x = "modified"
return x<CURSOR> # Should find the nonlocal x declaration in outer scope return x<CURSOR> # Should find the nonlocal x declaration in outer scope
return inner return inner
"#, "#,
); );
@ -1438,12 +1438,12 @@ def outer():
r#" r#"
def outer(): def outer():
xy = "outer_value" xy = "outer_value"
def inner(): def inner():
nonlocal x<CURSOR>y nonlocal x<CURSOR>y
xy = "modified" xy = "modified"
return x # Should find the nonlocal x declaration in outer scope return x # Should find the nonlocal x declaration in outer scope
return inner return inner
"#, "#,
); );

View File

@ -1708,12 +1708,12 @@ def ab(a: int, *, c: int):
r#" r#"
def outer(): def outer():
x = "outer_value" x = "outer_value"
def inner(): def inner():
nonlocal x nonlocal x
x = "modified" x = "modified"
return x<CURSOR> # Should find the nonlocal x declaration in outer scope return x<CURSOR> # Should find the nonlocal x declaration in outer scope
return inner return inner
"#, "#,
); );
@ -1747,12 +1747,12 @@ def outer():
r#" r#"
def outer(): def outer():
xy = "outer_value" xy = "outer_value"
def inner(): def inner():
nonlocal x<CURSOR>y nonlocal x<CURSOR>y
xy = "modified" xy = "modified"
return x # Should find the nonlocal x declaration in outer scope return x # Should find the nonlocal x declaration in outer scope
return inner return inner
"#, "#,
); );
@ -1960,7 +1960,7 @@ def function():
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, button=a<CURSOR>b): case Click(x, button=a<CURSOR>b):
@ -1980,7 +1980,7 @@ def function():
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, button=ab): case Click(x, button=ab):
@ -2018,7 +2018,7 @@ def function():
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Cl<CURSOR>ick(x, button=ab): case Cl<CURSOR>ick(x, button=ab):
@ -2057,7 +2057,7 @@ def function():
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, but<CURSOR>ton=ab): case Click(x, but<CURSOR>ton=ab):

View File

@ -2012,7 +2012,7 @@ mod tests {
def __init__(self, pos, btn): def __init__(self, pos, btn):
self.position: int = pos self.position: int = pos
self.button: str = btn self.button: str = btn
def my_func(event: Click): def my_func(event: Click):
match event: match event:
case Click(x, button=ab): case Click(x, button=ab):