@@ -219,8 +219,7 @@ def test_pretend_metadata_with_version(
219219
220220 # Test version file template functionality
221221 wd .write ("setup.py" , SETUP_PY_PLAIN )
222- wd ("mkdir -p src" ) # Create the src directory
223- # This is a template string, not an f-string - used by setuptools-scm templating
222+ wd ("mkdir -p src" )
224223 version_file_content = """
225224version = '{version}'
226225major = {version_tuple[0]}
@@ -234,7 +233,6 @@ def test_pretend_metadata_with_version(
234233 write_to = "src/version.py" , write_to_template = version_file_content
235234 )
236235
237- # Read the file using pathlib
238236 content = (wd .cwd / "src/version.py" ).read_text ()
239237 assert "commit_hash = 'g1337beef'" in content
240238 assert "num_commit = 4" in content
@@ -266,10 +264,8 @@ def test_pretend_metadata_without_version_warns(
266264 # Let's create an empty git repo without commits to truly have no base version
267265 monkeypatch .setenv (PRETEND_METADATA_KEY , '{node="g1234567", distance=2}' )
268266
269- # Should get a version with fallback but metadata overrides applied
270267 with caplog .at_level (logging .WARNING ):
271268 version = wd .get_version ()
272- # Should get a fallback version with metadata overrides
273269 assert version is not None
274270
275271 # In this case, metadata was applied to a fallback version, so no warning about missing base
@@ -301,7 +297,6 @@ def test_pretend_metadata_with_scm_version(
301297 # Test version file to see if metadata was applied
302298 wd .write ("setup.py" , SETUP_PY_PLAIN )
303299 wd ("mkdir -p src" )
304- # This is a template string, not an f-string - used by setuptools-scm templating
305300 version_file_content = """
306301version = '{version}'
307302commit_hash = '{scm_version.short_node}'
@@ -403,7 +398,6 @@ def test_git_tag_with_local_build_data_preserved(wd: WorkDir) -> None:
403398 f"Version should parse correctly as PEP 440: { version } "
404399 )
405400
406- # Should preserve the build metadata that was in the git tag
407401 assert version == "1.0.0+build.123" , (
408402 f"Expected build metadata preserved, got { version } "
409403 )
@@ -430,7 +424,6 @@ def test_git_tag_with_commit_hash_preserved(wd: WorkDir) -> None:
430424 f"Version should parse correctly as PEP 440: { version } "
431425 )
432426
433- # Should preserve the commit hash that was in the git tag
434427 assert version == "2.0.0+sha.abcd1234"
435428
436429 # Validate the local part is correct
@@ -459,7 +452,6 @@ def test_git_tag_with_local_build_data_preserved_dirty_workdir(wd: WorkDir) -> N
459452 f"Version should parse correctly as PEP 440: { version } "
460453 )
461454
462- # Should preserve the build metadata that was in the git tag
463455 assert version == "1.5.0+build.456" , (
464456 f"Expected build metadata preserved with dirty workdir, got { version } "
465457 )
0 commit comments