(tmp_commitizen_project, util: UtilFixture)
| 463 | |
| 464 | |
| 465 | def 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 | |
| 488 | def test_bump_local_version(tmp_commitizen_project, util: UtilFixture): |
nothing calls this directly
no test coverage detected