summaryrefslogtreecommitdiff
path: root/tests/test_config.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2020-05-23 09:17:45 -0400
committerNed Batchelder <ned@nedbatchelder.com>2020-05-23 13:42:44 -0400
commit2cee76e06445bfd39148b841b75086932decce27 (patch)
tree6e3bcaf759a3720cd686e065074cb0ed6f02358f /tests/test_config.py
parenta462ab4aeae93979b50ca0c366840a8a3dc2d8b8 (diff)
downloadpython-coveragepy-git-2cee76e06445bfd39148b841b75086932decce27.tar.gz
Read the config file contents as bytes, it's just for debugging anyway. #990
Diffstat (limited to 'tests/test_config.py')
-rw-r--r--tests/test_config.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index 51d9b9ef..89ecb17c 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -3,6 +3,7 @@
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Test the config file handling for coverage.py"""
+
from collections import OrderedDict
import mock
@@ -62,6 +63,8 @@ class ConfigTest(CoverageTest):
# A .coveragerc file will be read into the configuration.
self.make_file("pyproject.toml", """\
# This is just a bogus toml file for testing.
+ [tool.somethingelse]
+ authors = ["Joe D'Ávila <joe@gmail.com>"]
[tool.coverage.run]
concurrency = ["a", "b"]
timid = true
@@ -70,20 +73,23 @@ class ConfigTest(CoverageTest):
[tool.coverage.report]
precision = 3
fail_under = 90.5
+ [tool.coverage.html]
+ title = "tabblo & «ταБЬℓσ»"
[tool.coverage.plugins.a_plugin]
hello = "world"
""")
cov = coverage.Coverage(config_file="pyproject.toml")
self.assertTrue(cov.config.timid)
self.assertFalse(cov.config.branch)
- self.assertEqual(cov.config.concurrency, ["a", "b"])
- self.assertEqual(cov.config.data_file, ".hello_kitty.data")
- self.assertEqual(cov.config.plugins, ["plugins.a_plugin"])
+ self.assertEqual(cov.config.concurrency, [u"a", u"b"])
+ self.assertEqual(cov.config.data_file, u".hello_kitty.data")
+ self.assertEqual(cov.config.plugins, [u"plugins.a_plugin"])
self.assertEqual(cov.config.precision, 3)
+ self.assertEqual(cov.config.html_title, u"tabblo & «ταБЬℓσ»")
self.assertAlmostEqual(cov.config.fail_under, 90.5)
self.assertEqual(
cov.config.get_plugin_options("plugins.a_plugin"),
- {'hello': 'world'}
+ {u"hello": u"world"}
)
# Test that our class doesn't reject integers when loading floats