Skip to content
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

tests: make tests forward compatible for tomlkit fix for consistent line endings #5951

Merged
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
10 changes: 8 additions & 2 deletions tests/console/commands/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,14 @@ def test_add_to_section_that_does_not_exist_yet(
cachy = "^0.2.0"

"""

assert expected in content.as_string()
# At the moment line endings will be inconsistent on Windows.
# See https://github.com/sdispater/tomlkit/issues/200 for details.
# https://github.com/sdispater/tomlkit/pull/201 fixes this issue
# In order to make tests forward compatible for tomlkit downstream tests,
# we replace "\r\n" with "\n" for now.
string_content = content.as_string().replace("\r\n", "\n")

assert expected in string_content


def test_add_to_dev_section_deprecated(
Expand Down
26 changes: 22 additions & 4 deletions tests/console/commands/test_remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ def test_remove_without_specific_group_removes_from_all_groups(
baz = "^1.0.0"

"""
# At the moment line endings will be inconsistent on Windows.
# See https://github.com/sdispater/tomlkit/issues/200 for details.
# https://github.com/sdispater/tomlkit/pull/201 fixes this issue
# In order to make tests forward compatible for tomlkit downstream tests,
# we replace "\r\n" with "\n" for now.
string_content = content.as_string().replace("\r\n", "\n")

assert expected in content.as_string()
assert expected in string_content


def test_remove_without_specific_group_removes_from_specific_groups(
Expand Down Expand Up @@ -148,8 +154,14 @@ def test_remove_without_specific_group_removes_from_specific_groups(
baz = "^1.0.0"

"""
# At the moment line endings will be inconsistent on Windows.
# See https://github.com/sdispater/tomlkit/issues/200 for details.
# https://github.com/sdispater/tomlkit/pull/201 fixes this issue
# In order to make tests forward compatible for tomlkit downstream tests,
# we replace "\r\n" with "\n" for now.
string_content = content.as_string().replace("\r\n", "\n")

assert expected in content.as_string()
assert expected in string_content


def test_remove_does_not_live_empty_groups(
Expand Down Expand Up @@ -251,8 +263,14 @@ def test_remove_canonicalized_named_removes_dependency_correctly(
baz = "^1.0.0"

"""

assert expected in content.as_string()
# At the moment line endings will be inconsistent on Windows.
# See https://github.com/sdispater/tomlkit/issues/200 for details.
# https://github.com/sdispater/tomlkit/pull/201 fixes this issue
# In order to make tests forward compatible for tomlkit downstream tests,
# we replace "\r\n" with "\n" for now.
string_content = content.as_string().replace("\r\n", "\n")

assert expected in string_content


def test_remove_command_should_not_write_changes_upon_installer_errors(
Expand Down