Skip to content

Commit 69213bc

Browse files
committed
style: block formatting
1 parent b4fb278 commit 69213bc

4 files changed

Lines changed: 24 additions & 21 deletions

File tree

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
Replace this docstring with a description of your project.
55
"""
66

7-
__version__ = "0.1.0"
7+
__version__ = "0.1.0"

src/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
def greet(name: str = "World") -> str:
1010
"""
1111
Return a greeting message.
12-
12+
1313
Args:
1414
name: Name to greet
15-
15+
1616
Returns:
1717
Greeting message
18-
18+
1919
Examples:
2020
>>> greet()
2121
'Hello, World!'
@@ -35,4 +35,4 @@ def main() -> None:
3535

3636

3737
if __name__ == "__main__":
38-
main()
38+
main()

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""
22
Test package.
3-
"""
3+
"""

tests/test_main.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,48 @@
1010

1111
class TestGreet:
1212
"""Tests for the greet function."""
13-
13+
1414
def test_greet_default(self):
1515
"""Test greet with default argument."""
1616
result = greet()
1717
assert result == "Hello, World!"
18-
18+
1919
def test_greet_with_name(self):
2020
"""Test greet with custom name."""
2121
result = greet("Python")
2222
assert result == "Hello, Python!"
23-
23+
2424
def test_greet_empty_string(self):
2525
"""Test greet with empty string."""
2626
result = greet("")
2727
assert result == "Hello, !"
28-
29-
@pytest.mark.parametrize("name,expected", [
30-
("Alice", "Hello, Alice!"),
31-
("Bob", "Hello, Bob!"),
32-
("123", "Hello, 123!"),
33-
("🐍", "Hello, 🐍!"),
34-
])
28+
29+
@pytest.mark.parametrize(
30+
"name,expected",
31+
[
32+
("Alice", "Hello, Alice!"),
33+
("Bob", "Hello, Bob!"),
34+
("123", "Hello, 123!"),
35+
("🐍", "Hello, 🐍!"),
36+
],
37+
)
3538
def test_greet_parametrized(self, name, expected):
3639
"""Test greet with multiple inputs using parametrize."""
3740
assert greet(name) == expected
3841

3942

4043
class TestMain:
4144
"""Tests for the main function."""
42-
45+
4346
def test_main_runs_without_error(self, capsys):
4447
"""Test that main function runs without raising exceptions."""
4548
from src.main import main
46-
49+
4750
main()
48-
51+
4952
# Capture output
5053
captured = capsys.readouterr()
51-
54+
5255
# Check that something was printed
5356
assert "Your UV project is running" in captured.out
54-
assert "Hello, World!" in captured.out
57+
assert "Hello, World!" in captured.out

0 commit comments

Comments
 (0)