Skip to content

Commit 87aeb65

Browse files
CopilotAnselmoo
andauthored
Mark converter tests obsolete and deactivate flaky CI-blocking tests (including test_input on macOS/Windows) (#2091)
* Initial plan * fix: πŸ› mark converter tests obsolete and skip on win/macOS Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * test: βœ… deactivate requested flaky CLI and notebook tests Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * test: βœ… clarify skip reasons for deactivated tests Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * test: βœ… format lambda function for clarity and deactivate flaky subprocess version test * test: βœ… deactivate test_input suite on macOS and Windows Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> Co-authored-by: Anselm Hahn <Anselm.Hahn@gmail.com>
1 parent 75e1320 commit 87aeb65

5 files changed

Lines changed: 24 additions & 3 deletions

File tree

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ extend-ignore = [
175175
"UP007",
176176
"PLR0913",
177177
"S301",
178-
"PD901",
179178
"COM812",
180179
"FBT001", # Boolean type hint positional argument
181180
"FBT002", # Boolean default value positional argument
@@ -249,6 +248,7 @@ markers = [
249248
"models: tests for model implementations",
250249
"performance: tests that check performance characteristics",
251250
"integration: tests that check integration between components",
251+
"obsolete: obsolete or end-of-life tests",
252252
]
253253

254254
[tool.coverage.report]

β€Žspectrafit/models/test/test_moessbauer.pyβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,9 @@ def patch_dependencies(monkeypatch: pytest.MonkeyPatch) -> None:
478478
monkeypatch.setattr(
479479
moessbauer_mod,
480480
"lorentzian",
481-
lambda x, center, fwhml, amplitude: np.ones_like(x, dtype=np.float64) # noqa: ARG005
482-
* amplitude,
481+
lambda x, center, fwhml, amplitude: ( # noqa: ARG005
482+
np.ones_like(x, dtype=np.float64) * amplitude
483+
),
483484
)
484485
# Patch constants
485486
monkeypatch.setattr(moessbauer_mod, "MIN_EFG_THRESHOLD", 1e-5)

β€Žspectrafit/plugins/test/test_converter.pyβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import json
77
import pickle
88
import shutil
9+
import sys
910

1011
from pathlib import Path
1112
from typing import TYPE_CHECKING
@@ -31,6 +32,15 @@
3132
from spectrafit.plugins.rixs_converter import RIXSConverter
3233

3334

35+
pytestmark = [
36+
pytest.mark.obsolete,
37+
pytest.mark.skipif(
38+
sys.platform in {"win32", "darwin"},
39+
reason="obsolete converter plugin tests are skipped on Windows and macOS",
40+
),
41+
]
42+
43+
3444
if TYPE_CHECKING:
3545
from matplotlib.figure import Figure
3646
from numpy.typing import NDArray

β€Žspectrafit/plugins/test/test_notebook.pyβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ def test_dataframe_plot_4(self, dataframe_2: pd.DataFrame) -> None:
285285
)
286286
mock_show.assert_called_once()
287287

288+
@pytest.mark.skip(reason="deactivated due to flaky external HTTP dependency")
288289
def test_dataframe_plot_global(self, dataframe_global: pd.DataFrame) -> None:
289290
"""Test global plot."""
290291
pp = DataFramePlot()
@@ -586,6 +587,7 @@ def test_plot_fit(
586587
mock_show.assert_called_once()
587588

588589
@pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows")
590+
@pytest.mark.skip(reason="deactivated due to flaky external HTTP dependency")
589591
@pytest.mark.webtest
590592
def test_plot_global(
591593
self,

β€Žspectrafit/test/test_input.pyβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
BUILTINS_INPUT = "builtins.input"
1717

18+
pytestmark = pytest.mark.skipif(
19+
sys.platform in {"win32", "darwin"},
20+
reason="test_input CLI tests are deactivated on Windows and macOS",
21+
)
22+
1823

1924
def assert_no_critical_stderr(ret: Any) -> None:
2025
"""Allow warnings in stderr while ensuring no fatal errors occurred."""
@@ -25,6 +30,9 @@ def assert_no_critical_stderr(ret: Any) -> None:
2530
class TestCommandLineRunner:
2631
"""Testing the command line interface."""
2732

33+
@pytest.mark.skip(
34+
reason="deactivated flaky subprocess version test for CI stability"
35+
)
2836
def test_version(self, monkeypatch: Any, script_runner: Any) -> None:
2937
"""Testing the version command."""
3038
from spectrafit import __version__

0 commit comments

Comments
Β (0)