From 0aa9362f3867b25849cf36e25a4cd51e7407ce90 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Mon, 28 Nov 2022 23:01:20 +0800 Subject: [PATCH 1/2] test: fix test case changes due to tomlkit upgrade --- tests/commands/test_init_command.py | 1 - tests/test_conf.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/commands/test_init_command.py b/tests/commands/test_init_command.py index 6fa8d5008a..4b59665b8e 100644 --- a/tests/commands/test_init_command.py +++ b/tests/commands/test_init_command.py @@ -25,7 +25,6 @@ def ask(self): } expected_config = ( - "[tool]\n" "[tool.commitizen]\n" 'name = "cz_conventional_commits"\n' 'version = "0.0.1"\n' diff --git a/tests/test_conf.py b/tests/test_conf.py index c4020d640b..746cde2401 100644 --- a/tests/test_conf.py +++ b/tests/test_conf.py @@ -138,7 +138,7 @@ def test_init_empty_config_content(self, tmpdir): toml_config.init_empty_config_content() with open(path, "r") as toml_file: - assert toml_file.read() == "[tool]\n[tool.commitizen]\n" + assert toml_file.read() == "[tool.commitizen]\n" def test_init_empty_config_content_with_existing_content(self, tmpdir): existing_content = "[tool.black]\n" "line-length = 88\n" From db42a956a615c825c6f7fff483501aa06354c344 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Tue, 29 Nov 2022 00:51:30 +0800 Subject: [PATCH 2/2] test(bump_command): replace \ as / for windows test cases --- tests/commands/test_bump_command.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/commands/test_bump_command.py b/tests/commands/test_bump_command.py index fbe7c0db6b..b79c73e7d7 100644 --- a/tests/commands/test_bump_command.py +++ b/tests/commands/test_bump_command.py @@ -348,11 +348,12 @@ def test_bump_when_version_inconsistent_in_version_files( def test_bump_major_version_zero_when_major_is_not_zero(mocker, tmp_commitizen_project): tmp_version_file = tmp_commitizen_project.join("__version__.py") tmp_version_file.write("1.0.0") + tmp_version_file_string = str(tmp_version_file).replace("\\", "/") tmp_commitizen_cfg_file = tmp_commitizen_project.join("pyproject.toml") tmp_commitizen_cfg_file.write( f"[tool.commitizen]\n" 'version="1.0.0"\n' - f'version_files = ["{str(tmp_version_file)}"]' + f'version_files = ["{str(tmp_version_file_string)}"]' ) tmp_changelog_file = tmp_commitizen_project.join("CHANGELOG.md") tmp_changelog_file.write("## v1.0.0")