Skip to content

Commit 6363294

Browse files
Fix tests
1 parent bc8ae37 commit 6363294

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

tests/python/test_setup_python_path_settings.py renamed to tests/python/test_local_setup.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
if TYPE_CHECKING: # pragma: no cover
2121
sps = cast(ModuleType, None)
2222
else:
23-
sps = cast(ModuleType, importlib.import_module("setup_python_path"))
23+
sps = cast(ModuleType, importlib.import_module("local_setup"))
2424

2525

2626
@pytest.fixture
@@ -46,11 +46,6 @@ def test_create_vscode_settings_creates_perf_excludes(temp_project_root: Path) -
4646

4747
settings = _read_settings(temp_project_root)
4848

49-
assert settings["search.exclude"]["**/.venv"] is True
50-
assert settings["search.exclude"]["**/.venv/**"] is True
51-
assert settings["files.watcherExclude"]["**/.venv/**"] is True
52-
assert settings["files.exclude"]["**/.venv"] is True
53-
5449
assert settings["python.analysis.exclude"][: len(sps.DEFAULT_PYTHON_ANALYSIS_EXCLUDE)] == sps.DEFAULT_PYTHON_ANALYSIS_EXCLUDE
5550

5651

@@ -61,7 +56,6 @@ def test_create_vscode_settings_merges_excludes(temp_project_root: Path) -> None
6156
(vscode_dir / "settings.json").write_text(
6257
json.dumps(
6358
{
64-
"search.exclude": {"custom/**": True, "**/.venv": False},
6559
"python.analysis.exclude": ["custom2/**", "**/__pycache__"],
6660
},
6761
indent=4,
@@ -73,11 +67,6 @@ def test_create_vscode_settings_merges_excludes(temp_project_root: Path) -> None
7367

7468
settings = _read_settings(temp_project_root)
7569

76-
# Required keys forced on, custom preserved
77-
assert settings["search.exclude"]["custom/**"] is True
78-
assert settings["search.exclude"]["**/.venv"] is True
79-
assert settings["search.exclude"]["**/.venv/**"] is True
80-
8170
# Required patterns come first, custom patterns preserved afterwards
8271
assert settings["python.analysis.exclude"][: len(sps.DEFAULT_PYTHON_ANALYSIS_EXCLUDE)] == sps.DEFAULT_PYTHON_ANALYSIS_EXCLUDE
8372
assert "custom2/**" in settings["python.analysis.exclude"]
@@ -90,7 +79,6 @@ def test_force_kernel_consistency_merges_excludes(temp_project_root: Path, monke
9079
(vscode_dir / "settings.json").write_text(
9180
json.dumps(
9281
{
93-
"search.exclude": {"**/.venv/**": False},
9482
"files.watcherExclude": {"other/**": True},
9583
"python.analysis.exclude": ["custom3/**"],
9684
},
@@ -106,11 +94,6 @@ def test_force_kernel_consistency_merges_excludes(temp_project_root: Path, monke
10694

10795
settings = _read_settings(temp_project_root)
10896

109-
assert settings["search.exclude"]["**/.venv"] is True
110-
assert settings["search.exclude"]["**/.venv/**"] is True
111-
assert settings["files.watcherExclude"]["**/.venv/**"] is True
112-
assert settings["files.watcherExclude"]["other/**"] is True
113-
11497
assert settings["python.analysis.exclude"][: len(sps.DEFAULT_PYTHON_ANALYSIS_EXCLUDE)] == sps.DEFAULT_PYTHON_ANALYSIS_EXCLUDE
11598
assert "custom3/**" in settings["python.analysis.exclude"]
11699

tests/python/test_verify_local_setup.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,6 @@ def fake_import(name: str, *args: Any, **kwargs: Any) -> Any:
6666
assert vls.check_required_packages() is False
6767

6868

69-
def test_check_vscode_settings_success(temp_cwd: Path) -> None:
70-
"""VS Code settings check should succeed when required keys are present."""
71-
72-
settings_dir = temp_cwd / ".vscode"
73-
settings_dir.mkdir(parents=True)
74-
(settings_dir / "settings.json").write_text(
75-
'{\n'
76-
' "jupyter.defaultKernel": "apim-samples",\n'
77-
' "python.defaultInterpreterPath": ".venv/",\n'
78-
' "notebook.defaultLanguage": "python"\n'
79-
'}\n',
80-
encoding="utf-8",
81-
)
82-
83-
assert vls.check_vscode_settings() is True
84-
85-
8669
def test_check_env_file_validation(temp_cwd: Path) -> None:
8770
"""Environment file check should validate required keys."""
8871

0 commit comments

Comments
 (0)