Skip to content

Commit 1d506f3

Browse files
authored
Merge pull request #634 from NLeSC/580-ruff-check
2 parents 50d6dd7 + 9740a38 commit 1d506f3

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

template/src/{{package_name}}/my_module.py.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def hello(name: str) -> str:
2424
'Hello Jane Smith!'
2525

2626
"""
27-
if name == 'nobody':
28-
msg = 'Can not say hello to nobody'
27+
if name == "nobody":
28+
msg = "Can not say hello to nobody"
2929
raise ValueError(msg)
30-
return f'Hello {name}!'
30+
return f"Hello {name}!"

template/tests/test_my_module.py.jinja

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ from {{ package_name }}.my_module import hello
55

66
def test_hello():
77
"""Example using assert."""
8-
assert hello('nlesc') == 'Hello nlesc!'
8+
assert hello("nlesc") == "Hello nlesc!"
99

1010

1111
def test_hello_with_error():
1212
"""Example of testing for raised errors."""
1313
with pytest.raises(ValueError) as excinfo:
14-
hello('nobody')
15-
assert 'Can not say hello to nobody' in str(excinfo.value)
14+
hello("nobody")
15+
assert "Can not say hello to nobody" in str(excinfo.value)
1616

1717

1818
@pytest.fixture
1919
def some_name():
2020
"""Example fixture."""
21-
return 'Jane Smith'
21+
return "Jane Smith"
2222

2323

2424
def test_hello_with_fixture(some_name: str):
2525
"""Example using a fixture."""
26-
assert hello(some_name) == 'Hello Jane Smith!'
26+
assert hello(some_name) == "Hello Jane Smith!"

tests/test_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def test_ruff_check(baked_with_development_dependencies, project_env_bin_dir):
191191
project_dir = baked_with_development_dependencies
192192
bin_dir = project_env_bin_dir
193193

194-
result = run([f'{bin_dir}ruff', 'check', '--fix'], project_dir)
194+
result = run([f'{bin_dir}ruff', 'check'], project_dir)
195195
assert result.returncode == 0
196196
assert '' in result.stdout
197197

0 commit comments

Comments
 (0)