Skip to content

Commit 6b2b08c

Browse files
Fix linter issues
1 parent c3965d5 commit 6b2b08c

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

tests/test_config.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_named_config_file(self, file_class: FilePathType) -> None:
6868
assert cov.config.data_file == "delete.me"
6969

7070
@pytest.mark.parametrize("filename", ["pyproject.toml", ".coveragerc.toml"])
71-
def test_toml_config_file(self, filename) -> None:
71+
def test_toml_config_file(self, filename: str) -> None:
7272
# A pyproject.toml and coveragerc.toml will be read into the configuration.
7373
self.make_file(filename, """\
7474
# This is just a bogus toml file for testing.
@@ -100,7 +100,7 @@ def test_toml_config_file(self, filename) -> None:
100100
"hello": "world"}
101101

102102
@pytest.mark.parametrize("filename", ["pyproject.toml", ".coveragerc.toml"])
103-
def test_toml_ints_can_be_floats(self, filename) -> None:
103+
def test_toml_ints_can_be_floats(self, filename: str) -> None:
104104
# Test that our class doesn't reject integers when loading floats
105105
self.make_file(filename, """\
106106
# This is just a bogus toml file for testing.
@@ -242,7 +242,7 @@ def test_parse_errors(self, bad_config: str, msg: str) -> None:
242242
("[tool.coverage.report]\nprecision=1.23", "not an integer"),
243243
('[tool.coverage.report]\nfail_under="s"', "couldn't convert to a float"),
244244
])
245-
def test_toml_parse_errors(self, filename, bad_config: str, msg: str) -> None:
245+
def test_toml_parse_errors(self, filename: str, bad_config: str, msg: str) -> None:
246246
# Im-parsable values raise ConfigError, with details.
247247
self.make_file(filename, bad_config)
248248
with pytest.raises(ConfigError, match=msg):
@@ -272,7 +272,7 @@ def test_environment_vars_in_config(self) -> None:
272272
"the_$one", "anotherZZZ", "xZZZy", "xy", "huh${X}what"]
273273

274274
@pytest.mark.parametrize("filename", ["pyproject.toml", ".coveragerc.toml"])
275-
def test_environment_vars_in_toml_config(self, filename) -> None:
275+
def test_environment_vars_in_toml_config(self, filename: str) -> None:
276276
# Config files can have $envvars in them.
277277
self.make_file(filename, """\
278278
[tool.coverage.run]
@@ -339,7 +339,7 @@ def test_tilde_in_config(self) -> None:
339339
self.assert_tilde_results()
340340

341341
@pytest.mark.parametrize("filename", ["pyproject.toml", ".coveragerc.toml"])
342-
def test_tilde_in_toml_config(self, filename) -> None:
342+
def test_tilde_in_toml_config(self, filename: str) -> None:
343343
# Config entries that are file paths can be tilde-expanded.
344344
self.make_file(filename, """\
345345
[tool.coverage.run]
@@ -472,7 +472,7 @@ def test_unknown_option(self) -> None:
472472
_ = coverage.Coverage()
473473

474474
@pytest.mark.parametrize("filename", ["pyproject.toml", ".coveragerc.toml"])
475-
def test_unknown_option_toml(self, filename) -> None:
475+
def test_unknown_option_toml(self, filename: str) -> None:
476476
self.make_file(filename, """\
477477
[tool.coverage.run]
478478
xyzzy = 17
@@ -525,7 +525,7 @@ def test_exceptions_from_missing_things(self) -> None:
525525
config.get("xyzzy", "foo")
526526

527527
@pytest.mark.parametrize("filename", ["pyproject.toml", ".coveragerc.toml"])
528-
def test_exclude_also(self, filename) -> None:
528+
def test_exclude_also(self, filename: str) -> None:
529529
self.make_file(filename, """\
530530
[tool.coverage.report]
531531
exclude_also = ["foobar", "raise .*Error"]
@@ -900,7 +900,7 @@ def test_no_toml_installed_pyproject_no_coverage(self) -> None:
900900
assert cov.config.data_file == ".coverage"
901901

902902
@pytest.mark.parametrize("filename", ["pyproject.toml", ".coveragerc.toml"])
903-
def test_exceptions_from_missing_toml_things(self, filename) -> None:
903+
def test_exceptions_from_missing_toml_things(self, filename: str) -> None:
904904
self.make_file(filename, """\
905905
[tool.coverage.run]
906906
branch = true
@@ -934,8 +934,7 @@ def test_coveragerc_toml_priority(self) -> None:
934934
assert cov.config.timid is True
935935
assert cov.config.data_file == ".toml-data.dat"
936936
assert cov.config.branch is True
937-
938-
937+
939938
@pytest.mark.skipif(env.PYVERSION >= (3, 11), reason="Python 3.11 has toml in stdlib")
940939
def test_toml_file_exists_but_no_toml_support(self) -> None:
941940
"""Test behavior when .coveragerc.toml exists but TOML support is missing."""
@@ -944,7 +943,7 @@ def test_toml_file_exists_but_no_toml_support(self) -> None:
944943
timid = true
945944
data_file = ".toml-data.dat"
946945
""")
947-
946+
948947
with mock.patch.object(coverage.tomlconfig, "has_tomllib", False):
949948
msg = "Can't read '.coveragerc.toml' without TOML support"
950949
with pytest.raises(ConfigError, match=msg):
@@ -954,7 +953,7 @@ def test_toml_file_exists_but_no_toml_support(self) -> None:
954953
timid = false
955954
data_file = .ini-data.dat
956955
""")
957-
956+
958957
cov = coverage.Coverage()
959958
assert not cov.config.timid
960959
assert cov.config.data_file == ".ini-data.dat"

0 commit comments

Comments
 (0)