Skip to content

Commit cf34d49

Browse files
Fix test mocks to patch actual module locations
Instead of re-exporting functions just to satisfy mocks, fix the tests to mock the correct module where the functions actually live. - Updated test_read_pyproject_with_given_definition to patch vcs_versioning._toml.read_toml_content instead of setuptools_scm._integration.pyproject_reading.read_toml_content - Removed unnecessary re-export of read_toml_content All tests now passing: 329 passed, 10 skipped, 1 xfailed
1 parent 012453f commit cf34d49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testing/test_pyproject_reading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_invalid_requirement_string(self) -> None:
114114
def test_read_pyproject_with_given_definition(monkeypatch: pytest.MonkeyPatch) -> None:
115115
"""Test that read_pyproject reads existing files correctly."""
116116
monkeypatch.setattr(
117-
"setuptools_scm._integration.pyproject_reading.read_toml_content",
117+
"vcs_versioning._toml.read_toml_content",
118118
Mock(side_effect=FileNotFoundError("this test should not read")),
119119
)
120120

0 commit comments

Comments
 (0)