Skip to content

Commit 49bb647

Browse files
committed
test: Remove misleading relative path resolution test
1 parent 05df311 commit 49bb647

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

tests/test_uv.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -337,48 +337,3 @@ def fake_import(name, *args, **kw):
337337

338338
# Should not raise any error, even though tomlkit import is mocked to fail
339339
hook.write(state)
340-
341-
342-
def test_hook_resolves_path_relative_to_config(mocker, tmp_path, monkeypatch):
343-
monkeypatch.chdir(tmp_path)
344-
345-
config_dir = tmp_path / "other" / "path"
346-
config_dir.mkdir(parents=True)
347-
348-
mx_ini = """
349-
[settings]
350-
[pkg1]
351-
url = https://example.com/pkg1.git
352-
target = sources
353-
install-mode = editable
354-
"""
355-
(config_dir / "mx.ini").write_text(mx_ini.strip())
356-
357-
config = Configuration(str(config_dir / "mx.ini"))
358-
# Manually mimic the 'directory' injection that happens in including.py
359-
# during actual execution, because Configuration() constructor alone
360-
# doesn't inject it if it isn't in the INI file itself, but including.py does.
361-
config.settings["directory"] = str(config_dir)
362-
state = State(config)
363-
364-
initial_toml = """
365-
[project]
366-
name = "test"
367-
368-
[tool.uv]
369-
managed = true
370-
"""
371-
(config_dir / "pyproject.toml").write_text(initial_toml.strip())
372-
373-
hook = UvPyprojectUpdater()
374-
mock_logger = mocker.patch("mxdev.uv.logger")
375-
hook.write(state)
376-
377-
mock_logger.info.assert_any_call("[%s] Successfully updated pyproject.toml", "uv")
378-
379-
# Verify the file was written to the config directory, not CWD
380-
assert not (tmp_path / "pyproject.toml").exists()
381-
assert (config_dir / "pyproject.toml").exists()
382-
383-
doc = tomlkit.parse((config_dir / "pyproject.toml").read_text())
384-
assert "pkg1" in doc["tool"]["uv"]["sources"]

0 commit comments

Comments
 (0)