Skip to content

Commit dc10df0

Browse files
authored
Merge pull request #626 from commitizen-tools/fix-test-case-change-due-to-tomlkit-upgrade
test: fix test case changes due to tomlkit upgrade
2 parents 6b8ac42 + db42a95 commit dc10df0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tests/commands/test_bump_command.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,12 @@ def test_bump_when_version_inconsistent_in_version_files(
348348
def test_bump_major_version_zero_when_major_is_not_zero(mocker, tmp_commitizen_project):
349349
tmp_version_file = tmp_commitizen_project.join("__version__.py")
350350
tmp_version_file.write("1.0.0")
351+
tmp_version_file_string = str(tmp_version_file).replace("\\", "/")
351352
tmp_commitizen_cfg_file = tmp_commitizen_project.join("pyproject.toml")
352353
tmp_commitizen_cfg_file.write(
353354
f"[tool.commitizen]\n"
354355
'version="1.0.0"\n'
355-
f'version_files = ["{str(tmp_version_file)}"]'
356+
f'version_files = ["{str(tmp_version_file_string)}"]'
356357
)
357358
tmp_changelog_file = tmp_commitizen_project.join("CHANGELOG.md")
358359
tmp_changelog_file.write("## v1.0.0")

tests/commands/test_init_command.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def ask(self):
2525
}
2626

2727
expected_config = (
28-
"[tool]\n"
2928
"[tool.commitizen]\n"
3029
'name = "cz_conventional_commits"\n'
3130
'version = "0.0.1"\n'

tests/test_conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_init_empty_config_content(self, tmpdir):
138138
toml_config.init_empty_config_content()
139139

140140
with open(path, "r") as toml_file:
141-
assert toml_file.read() == "[tool]\n[tool.commitizen]\n"
141+
assert toml_file.read() == "[tool.commitizen]\n"
142142

143143
def test_init_empty_config_content_with_existing_content(self, tmpdir):
144144
existing_content = "[tool.black]\n" "line-length = 88\n"

0 commit comments

Comments
 (0)