Skip to content

Commit

Permalink
test: check it toml files with \r endings are ok. #1196
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Nov 9, 2024
1 parent 84baf6e commit 6994f0e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ def test_toml_config_file(self) -> None:
assert cov.config.fail_under == 90.5
assert cov.config.get_plugin_options("plugins.a_plugin") == {"hello": "world"}

def test_toml_config_file_weird_endings(self) -> None:
# A pyproject.toml file will be read into the configuration.
self.make_file("pyproject.toml", """\
[tool.coverage.run]
timid = true
[tool.coverage.report]
precision = 3
[tool.coverage.html]
title = "tabblo & «ταБЬℓσ»"
""", newline="\r")
cov = coverage.Coverage()
assert cov.config.timid
assert cov.config.precision == 3
assert cov.config.html_title == "tabblo & «ταБЬℓσ»"

def test_toml_ints_can_be_floats(self) -> None:
# Test that our class doesn't reject integers when loading floats
self.make_file("pyproject.toml", """\
Expand Down

0 comments on commit 6994f0e

Please sign in to comment.