diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-12-13 17:00:47 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-12-13 17:00:47 -0500 |
commit | 5f6d7931bc6e217a8531de1375d31f94351c5c6e (patch) | |
tree | 5be666f9629618257916d56fde2e6d72051535be /test | |
parent | 8beecff66f160a404217d7ebdff5493a7178b046 (diff) | |
download | python-coveragepy-git-5f6d7931bc6e217a8531de1375d31f94351c5c6e.tar.gz |
Rename the config file option for excluding source lines, in prep for excluding files.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_config.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/test/test_config.py b/test/test_config.py index 4272e8aa..926de181 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -8,7 +8,7 @@ from coveragetest import CoverageTest class ConfigTest(CoverageTest): - """Tests of the config file support.""" + """Tests of the different sources of configuration settings.""" def test_default_config(self): # Just constructing a coverage() object gets the right defaults. @@ -87,3 +87,32 @@ class ConfigTest(CoverageTest): # But the constructor args override the env var. cov = coverage.coverage(data_file="fromarg.dat") self.assertEqual(cov.config.data_file, "fromarg.dat") + + +class ConfigFileTest(CoverageTest): + """Tests of the config file settings in particular.""" + + def test_config_file_settings(self): + self.make_file(".coveragerc", """\ + # This is a settings file for coverage.py + [run] + timid = yes + data_file = something_or_other.dat + branch = 0 + cover_pylib = TRUE + + [report] + ; these settings affect reporting. + exclude_lines = + if 0: + pragma:?\s+no cover + another_tab + """) + cov = coverage.coverage() + self.assertFalse(cov.config.branch) + self.assertTrue(cov.config.timid) + self.assertTrue(cov.config.cover_pylib) + self.assertEqual(cov.config.data_file, "something_or_other.dat") + self.assertEqual(cov.get_exclude_list(), + ["if 0:", "pragma:?\s+no cover", "another_tab"] + ) |