Skip to content

Commit 9944fa5

Browse files
committed
Fix ruff errors
1 parent 8909d67 commit 9944fa5

File tree

8 files changed

+11
-13
lines changed

8 files changed

+11
-13
lines changed

taps/apps/physics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def create_terrain_plot(
142142
x, y = numpy.meshgrid(x, y)
143143

144144
for ax, positions in zip(axs, (initial_positions, final_positions)):
145-
px, py, pz = zip(*positions)
145+
px, py, _ = zip(*positions)
146146
xy = numpy.vstack([px, py])
147147
kde = gaussian_kde(xy)(xy)
148148
kde_grid = numpy.zeros_like(heightmap)

tests/apps/configs/cholesky_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_create_app() -> None:
1515
def test_validation_error() -> None:
1616
with pytest.raises(
1717
ValidationError,
18-
match='The matrix size and block size must be greater than 0.',
18+
match=r'The matrix size and block size must be greater than 0.',
1919
):
2020
CholeskyConfig(matrix_size=-1, block_size=5)
2121

tests/apps/configs/failures_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
import re
4-
53
import pytest
64
from pydantic import ValidationError
75

@@ -21,14 +19,14 @@ def test_create_app() -> None:
2119
def test_validate_base_app() -> None:
2220
with pytest.raises(
2321
ValidationError,
24-
match='Base app named "fake-app" is unknown.',
22+
match=r'Base app named "fake-app" is unknown.',
2523
):
2624
FailureInjectionConfig(base='fake-app')
2725

2826

2927
def test_validate_rate() -> None:
3028
with pytest.raises(
3129
ValidationError,
32-
match=re.escape('Failure rate must be in the range [0, 1]. Got 2.1.'),
30+
match=r'Failure rate must be in the range \[0, 1\]. Got 2.1.',
3331
):
3432
FailureInjectionConfig(base='mock-app', failure_rate=2.1)

tests/apps/configs/synthetic_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def test_validate_rate() -> None:
1919
with pytest.raises(
2020
ValidationError,
2121
match=(
22-
"Option 'bag_max_running' must be specified when "
23-
"'bag' is specified."
22+
r"Option 'bag_max_running' must be specified when "
23+
r"'bag' is specified."
2424
),
2525
):
2626
SyntheticConfig(structure='bag', task_count=3)

tests/apps/failures/types_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ def test_simple_failures(
2626
exc_type: type[Exception],
2727
) -> None:
2828
function = FAILURE_FUNCTIONS[failure_type]
29-
with pytest.raises(exc_type, match='Failure injection error.'):
29+
with pytest.raises(exc_type, match=r'Failure injection error.'):
3030
function()

tests/executor/utils_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_dag_executor_shutdown(thread_executor: ThreadPoolExecutor) -> None:
5151
def test_dag_executor_map_value_error(
5252
executor: FutureDependencyExecutor,
5353
) -> None:
54-
with pytest.raises(ValueError, match='chunksize must be >= 1.'):
54+
with pytest.raises(ValueError, match=r'chunksize must be >= 1.'):
5555
executor.map(abs, [], chunksize=0)
5656

5757

tests/plugins_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_get_transformer_configs() -> None:
2727

2828

2929
def test_register_bad_kind() -> None:
30-
with pytest.raises(ValueError, match='Unknown plugin type "test".'):
30+
with pytest.raises(ValueError, match=r'Unknown plugin type "test".'):
3131
register('test')(BaseModel) # type: ignore[arg-type]
3232

3333

tests/run/parse_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ def test_exit_on_only_help(capsys) -> None:
2828

2929

3030
def test_parse_args_missing_app(tmp_path: pathlib.Path) -> None:
31-
with pytest.raises(ValueError, match='App name option is required.'):
31+
with pytest.raises(ValueError, match=r'App name option is required.'):
3232
parse_args_to_config(['--engine.executor', 'process-pool'])
3333

3434
config_file = tmp_path / 'config.toml'
3535
with open(config_file, 'w') as f:
3636
f.write('[app]')
3737

38-
with pytest.raises(ValueError, match='App name option is required.'):
38+
with pytest.raises(ValueError, match=r'App name option is required.'):
3939
parse_args_to_config(['--config', str(config_file)])
4040

4141

0 commit comments

Comments
 (0)