@@ -73,17 +73,14 @@ def test_hg_command_from_env(
73
73
request : pytest .FixtureRequest ,
74
74
hg_exe : str ,
75
75
) -> None :
76
- with monkeypatch .context () as m :
77
- m .setenv ("SETUPTOOLS_SCM_HG_COMMAND" , hg_exe )
78
- m .setenv ("PATH" , str (wd .cwd / "not-existing" ))
79
- wd .write ("pyproject.toml" , "[tool.setuptools_scm]" )
80
- # Use the configured hg command for test operations
81
- wd .add_command = f"{ hg_exe } add ."
82
- wd .commit_command = f'{ hg_exe } commit -m test-{{reason}} -u test -d "0 0"'
83
- # Need to commit something first for versioning to work
84
- wd .commit_testfile ()
85
- version = wd .get_version ()
86
- assert version .startswith ("0.1.dev1+" )
76
+ wd .write ("pyproject.toml" , "[tool.setuptools_scm]" )
77
+ # Need to commit something first for versioning to work
78
+ wd .commit_testfile ()
79
+
80
+ monkeypatch .setenv ("SETUPTOOLS_SCM_HG_COMMAND" , hg_exe )
81
+ monkeypatch .setenv ("PATH" , str (wd .cwd / "not-existing" ))
82
+ version = wd .get_version ()
83
+ assert version .startswith ("0.1.dev1+" )
87
84
88
85
89
86
def test_hg_command_from_env_is_invalid (
@@ -94,7 +91,7 @@ def test_hg_command_from_env_is_invalid(
94
91
# No module reloading needed - runtime configuration works immediately
95
92
config = Configuration ()
96
93
wd .write ("pyproject.toml" , "[tool.setuptools_scm]" )
97
- with pytest .raises (CommandNotFoundError , match = r"hg " ):
94
+ with pytest .raises (CommandNotFoundError , match = r"test.*hg.*not-existing " ):
98
95
parse (wd .cwd , config = config )
99
96
100
97
assert wd .get_version (fallback_version = "1.0" ) == "1.0"
0 commit comments