diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-12-27 19:08:47 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-12-27 20:04:01 -0500 |
commit | 3823cc6d41956d0b8cfb55d6151673017a825c49 (patch) | |
tree | dee19404fd1594ed0d30fca64862e8b62cb175bf /tests/test_config.py | |
parent | 012a687b45fba8f8b3feb5aef9cd2f0c6e860d43 (diff) | |
download | python-coveragepy-git-3823cc6d41956d0b8cfb55d6151673017a825c49.tar.gz |
fix: [tools.coverage] is valid for settings in a toml file. #1516
Diffstat (limited to 'tests/test_config.py')
-rw-r--r-- | tests/test_config.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index ccc4305f..d88a1a4f 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -739,6 +739,19 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest): with pytest.raises(ConfigError, match=msg): coverage.Coverage() + @pytest.mark.skipif(sys.version_info >= (3, 11), reason="Python 3.11 has toml in stdlib") + def test_no_toml_installed_pyproject_toml_shorter_syntax(self): + # Can't have coverage config in pyproject.toml without toml installed. + self.make_file("pyproject.toml", """\ + # A toml file! + [tool.coverage] + run.parallel = true + """) + with without_module(coverage.tomlconfig, 'tomllib'): + msg = "Can't read 'pyproject.toml' without TOML support" + with pytest.raises(ConfigError, match=msg): + coverage.Coverage() + def test_no_toml_installed_pyproject_no_coverage(self): # It's ok to have non-coverage pyproject.toml without toml installed. self.make_file("pyproject.toml", """\ |