MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / test_bump_files_only

Function test_bump_files_only

tests/commands/test_bump_command.py:465–485  ·  view source on GitHub ↗
(tmp_commitizen_project, util: UtilFixture)

Source from the content-addressed store, hash-verified

463
464
465def test_bump_files_only(tmp_commitizen_project, util: UtilFixture):
466 tmp_version_file = tmp_commitizen_project / "__version__.py"
467 tmp_version_file.write_text("0.1.0")
468 tmp_commitizen_cfg_file = tmp_commitizen_project / "pyproject.toml"
469 tmp_version_file_string = str(tmp_version_file).replace("\\", "/")
470 with tmp_commitizen_cfg_file.open("a", encoding="utf-8") as f:
471 f.write(f'\nversion_files = ["{tmp_version_file_string}"]')
472
473 util.create_file_and_commit("feat: new user interface")
474 util.run_cli("bump", "--yes")
475 assert git.tag_exist("0.2.0") is True
476
477 util.create_file_and_commit("feat: another new feature")
478 with pytest.raises(ExpectedExit):
479 util.run_cli("bump", "--yes", "--version-files-only")
480
481 assert git.tag_exist("0.3.0") is False
482
483 assert "0.3.0" in tmp_version_file.read_text(encoding="utf-8")
484
485 assert "0.3.0" in tmp_commitizen_cfg_file.read_text(encoding="utf-8")
486
487
488def test_bump_local_version(tmp_commitizen_project, util: UtilFixture):

Callers

nothing calls this directly

Calls 2

run_cliMethod · 0.80

Tested by

no test coverage detected