From f0d392172be0eb45a87ee3fe10b9603102cb0288 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 23 May 2020 08:25:01 -0400 Subject: [PATCH] A test for bug 990 --- tests/test_config.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 51d9b9efa..89ecb17c6 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 @@ def test_toml_config_file(self): # 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 "] [tool.coverage.run] concurrency = ["a", "b"] timid = true @@ -70,20 +73,23 @@ def test_toml_config_file(self): [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