summaryrefslogtreecommitdiff
path: root/test/test_config.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-11-28 20:24:23 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-11-28 20:24:23 -0500
commitc72bfe70f9f8ac6d573689798b364bd664b93444 (patch)
treed356597357f024c6e252c8fc47137b74e42b8bc2 /test/test_config.py
parent49ede2bdf54a12e4eaa9472785cc5544040c077a (diff)
downloadpython-coveragepy-git-c72bfe70f9f8ac6d573689798b364bd664b93444.tar.gz
Add data_file to the .coveragerc file.
--HG-- branch : config
Diffstat (limited to 'test/test_config.py')
-rw-r--r--test/test_config.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/test_config.py b/test/test_config.py
index 4206fa98..06d43d31 100644
--- a/test/test_config.py
+++ b/test/test_config.py
@@ -15,49 +15,61 @@ class ConfigTest(CoverageTest):
cov = coverage.coverage()
self.assertFalse(cov.config.timid)
self.assertFalse(cov.config.branch)
+ self.assertEqual(cov.config.data_file, ".coverage")
def test_arguments(self):
# Arguments to the constructor are applied to the configuation.
- cov = coverage.coverage(timid=True)
+ cov = coverage.coverage(timid=True, data_file="fooey.dat")
self.assert_(cov.config.timid)
self.assertFalse(cov.config.branch)
+ self.assertEqual(cov.config.data_file, "fooey.dat")
def test_config_file(self):
# A .coveragerc file will be read into the configuration.
self.make_file(".coveragerc", """\
+ # This is just a bogus .rc file for testing.
[run]
- timid = True
+ timid = True
+ data_file = .hello_kitty.data
""")
cov = coverage.coverage()
self.assert_(cov.config.timid)
self.assertFalse(cov.config.branch)
+ self.assertEqual(cov.config.data_file, ".hello_kitty.data")
def test_named_config_file(self):
# You can name the config file what you like.
self.make_file("my_cov.ini", """\
[run]
timid = True
+ ; I wouldn't really use this as a data file...
+ data_file = delete.me
""")
cov = coverage.coverage(config_file="my_cov.ini")
self.assert_(cov.config.timid)
self.assertFalse(cov.config.branch)
+ self.assertEqual(cov.config.data_file, "delete.me")
def test_ignored_config_file(self):
# You can disable reading the .coveragerc file.
self.make_file(".coveragerc", """\
[run]
timid = True
+ data_file = delete.me
""")
cov = coverage.coverage(config_file=False)
self.assertFalse(cov.config.timid)
self.assertFalse(cov.config.branch)
+ self.assertEqual(cov.config.data_file, ".coverage")
def test_config_file_then_args(self):
# The arguments override the .coveragerc file.
self.make_file(".coveragerc", """\
[run]
timid = True
+ data_file = weirdo.file
""")
- cov = coverage.coverage(timid=False)
+ cov = coverage.coverage(timid=False, data_file=".mycov")
self.assertFalse(cov.config.timid)
self.assertFalse(cov.config.branch)
+ self.assertEqual(cov.config.data_file, ".mycov")