Skip to content

Commit 657d2cf

Browse files
committed
extend per-file ignores for PLR2004 and remove noqa overrides in specific tests
1 parent d08e2c4 commit 657d2cf

9 files changed

+4
-28
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ ignore = [
134134
]
135135

136136
[tool.ruff.lint.per-file-ignores]
137-
"tests/*" = ["S101"]
137+
"tests/*" = ["S101", "PLR2004"]
138138
"tests/integration/test_segy_import_export_masked.py" = ["E501"]
139139
"docs/tutorials/*.ipynb" = ["S101"]
140140

tests/integration/test_segy_import_export.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ class TestReader:
272272
def test_meta_read(self, zarr_tmp: Path) -> None:
273273
"""Metadata reading tests."""
274274
mdio = MDIOReader(zarr_tmp.__str__())
275-
assert mdio.binary_header["samples_per_trace"] == 1501 # noqa: PLR2004
276-
assert mdio.binary_header["sample_interval"] == 2000 # noqa: PLR2004
275+
assert mdio.binary_header["samples_per_trace"] == 1501
276+
assert mdio.binary_header["sample_interval"] == 2000
277277

278278
def test_grid(self, zarr_tmp: Path) -> None:
279279
"""Grid reading tests."""

tests/unit/test_dimension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TestDimension:
1717

1818
def test_len(self, my_dimension: Dimension) -> None:
1919
"""Test length method."""
20-
assert len(my_dimension) == 4 # noqa: PLR2004
20+
assert len(my_dimension) == 4
2121

2222
@pytest.mark.parametrize(("index", "expected"), [(1, 12), (-1, 16), (2, 14)])
2323
def test_getitem(self, my_dimension: Dimension, index: int, expected: int) -> None:

tests/unit/v1/test_dataset_builder_add_coordinate.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# ruff: noqa: PLR2004
2-
# PLR2004 Magic value used in comparison, consider replacing `3` with a constant variable
3-
# The above erroneous warning is generated for every numerical assert.
4-
# Thus, disable it for this file
51
"""Tests the schema v1 dataset_builder.add_coordinate() public API."""
62

73
import pytest

tests/unit/v1/test_dataset_builder_add_dimension.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# ruff: noqa: PLR2004
2-
# PLR2004 Magic value used in comparison, consider replacing `3` with a constant variable
3-
# The above erroneous warning is generated for every numerical assert.
4-
# Thus, disable it for this file
51
"""Tests the schema v1 dataset_builder.add_dimension() public API."""
62

73
import pytest

tests/unit/v1/test_dataset_builder_add_variable.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# ruff: noqa: PLR2004
2-
# PLR2004 Magic value used in comparison, consider replacing `3` with a constant variable
3-
# The above erroneous warning is generated for every numerical assert.
4-
# Thus, disable it for this file
51
"""Tests the schema v1 dataset_builder.add_variable() public API."""
62

73
import pytest

tests/unit/v1/test_dataset_builder_build.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# ruff: noqa: PLR2004
2-
# PLR2004 Magic value used in comparison, consider replacing `3` with a constant variable
3-
# The above erroneous warning is generated for every numerical assert.
4-
# Thus, disable it for this file
51
"""Tests the schema v1 dataset_builder.build() public API."""
62

73
from mdio.schemas.dtype import ScalarType

tests/unit/v1/test_dataset_builder_helpers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# ruff: noqa: PLR2004
2-
# PLR2004 Magic value used in comparison, consider replacing `3` with a constant variable
3-
# The above erroneous warning is generated for every numerical assert.
4-
# Thus, disable it for this file
51
"""Tests the schema v1 dataset_builder internal methods."""
62

73
from datetime import UTC

tests/unit/v1/test_dataset_serializer.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# ruff: noqa: PLR2004
2-
# PLR2004 Magic value used in comparison, consider replacing `3` with a constant variable
3-
# The above erroneous warning is generated for every numerical assert.
4-
# Thus, disable it for this file
51
"""Tests the schema v1 dataset_serializer public API."""
62

73
import pytest

0 commit comments

Comments
 (0)