Use already generated config path in test_edit_config_with_custom_path

This commit is contained in:
Emi Katagiri-Simpson 2025-10-28 16:46:43 -04:00
parent 1a1fcbc3bc
commit 1e1c649398
No known key found for this signature in database

View file

@ -130,13 +130,9 @@ class ConfigCommandTest(BeetsTestCase):
execlp.assert_called_once_with("myeditor", "myeditor", self.config_path)
def test_edit_config_with_custom_config_path(self):
alt_config_path = os.path.join(
self.temp_dir.decode(), "alt_config.yaml"
)
with open(self.config_path, "w") as file:
file.write("option: alt value\n")
os.environ["EDITOR"] = "myeditor"
with patch("os.execlp") as execlp:
self.run_command("--config", alt_config_path, "config", "-e")
execlp.assert_called_once_with("myeditor", "myeditor", alt_config_path)
self.run_command("--config", self.cli_config_path, "config", "-e")
execlp.assert_called_once_with(
"myeditor", "myeditor", self.cli_config_path
)