From 3347fd65ca28f26c443cdc902089c0ad2b72d6d9 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Wed, 15 Oct 2025 11:44:59 -0700 Subject: [PATCH] Fix remaining linting issues - combine nested with statements --- integrations/beads-mcp/tests/test_config.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/integrations/beads-mcp/tests/test_config.py b/integrations/beads-mcp/tests/test_config.py index 79fc3597..30d469a5 100644 --- a/integrations/beads-mcp/tests/test_config.py +++ b/integrations/beads-mcp/tests/test_config.py @@ -1,7 +1,5 @@ """Tests for beads_mcp.config module.""" -import os -import shutil from pathlib import Path from unittest.mock import patch @@ -19,11 +17,9 @@ class TestConfig: monkeypatch.delenv("BEADS_PATH", raising=False) # Mock shutil.which to return a test path - with patch("shutil.which", return_value="/usr/local/bin/bd"): - # Mock os.access to say the file is executable - with patch("os.access", return_value=True): - config = Config() - assert config.beads_path == "/usr/local/bin/bd" + with patch("shutil.which", return_value="/usr/local/bin/bd"), patch("os.access", return_value=True): + config = Config() + assert config.beads_path == "/usr/local/bin/bd" def test_beads_path_from_env(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: """Test that BEADS_PATH environment variable is respected.""" @@ -41,11 +37,9 @@ class TestConfig: monkeypatch.setenv("BEADS_PATH", "bd") # Mock shutil.which to simulate finding bd in PATH - with patch("shutil.which", return_value="/usr/local/bin/bd"): - # Mock os.access to say the file is executable - with patch("os.access", return_value=True): - config = Config() - assert config.beads_path == "/usr/local/bin/bd" + with patch("shutil.which", return_value="/usr/local/bin/bd"), patch("os.access", return_value=True): + config = Config() + assert config.beads_path == "/usr/local/bin/bd" def test_beads_path_not_found(self, monkeypatch: pytest.MonkeyPatch) -> None: """Test that invalid BEADS_PATH raises ValueError."""