Skip to content

test: fix test case changes due to tomlkit upgrade #626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/commands/test_bump_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion tests/commands/test_init_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def ask(self):
}

expected_config = (
"[tool]\n"
"[tool.commitizen]\n"
'name = "cz_conventional_commits"\n'
'version = "0.0.1"\n'
Expand Down
2 changes: 1 addition & 1 deletion tests/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down