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

Function test_bump_local_version

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

Source from the content-addressed store, hash-verified

486
487
488def test_bump_local_version(tmp_commitizen_project, util: UtilFixture):
489 tmp_version_file = tmp_commitizen_project / "__version__.py"
490 tmp_version_file.write_text("4.5.1+0.1.0")
491 tmp_commitizen_cfg_file = tmp_commitizen_project / "pyproject.toml"
492 tmp_version_file_string = str(tmp_version_file).replace("\\", "/")
493 tmp_commitizen_cfg_file.write_text(
494 f"[tool.commitizen]\n"
495 'version="4.5.1+0.1.0"\n'
496 f'version_files = ["{tmp_version_file_string}"]'
497 )
498
499 util.create_file_and_commit("feat: new user interface")
500 util.run_cli("bump", "--yes", "--local-version")
501 assert git.tag_exist("4.5.1+0.2.0") is True
502
503 assert "4.5.1+0.2.0" in tmp_version_file.read_text(encoding="utf-8")
504
505
506@pytest.mark.usefixtures("tmp_commitizen_project")

Callers

nothing calls this directly

Calls 2

run_cliMethod · 0.80

Tested by

no test coverage detected