diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-25 17:16:59 -0500 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-25 17:16:59 -0500 |
| commit | 86eb1db2365143d025fa64a67587c1723977e787 (patch) | |
| tree | c05a2692889c132ce9a7eaea0fec2d3f29873fe3 /test | |
| parent | 34fdddd0dae03ab57289dfe5807158e672f7f9ef (diff) | |
| download | python-coveragepy-86eb1db2365143d025fa64a67587c1723977e787.tar.gz | |
Config files now can use environment variables. #97.
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_config.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test_config.py b/test/test_config.py index 19e37ab..1fdc2ce 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -98,6 +98,30 @@ class ConfigTest(CoverageTest): """) self.assertRaises(CoverageException, coverage.coverage) + def test_environment_vars_in_config(self): + # Config files can have $envvars in them. + self.make_file(".coveragerc", """\ + [run] + data_file = $DATA_FILE.fooey + branch = $OKAY + [report] + exclude_lines = + the_$$one + another${THING} + x${THING}y + x${NOTHING}y + huh$${X}what + """) + self.set_environ("DATA_FILE", "hello-world") + self.set_environ("THING", "ZZZ") + self.set_environ("OKAY", "yes") + cov = coverage.coverage() + self.assertEqual(cov.config.data_file, "hello-world.fooey") + self.assertEqual(cov.config.branch, True) + self.assertEqual(cov.config.exclude_list, + ["the_$one", "anotherZZZ", "xZZZy", "xy", "huh${X}what"] + ) + class ConfigFileTest(CoverageTest): """Tests of the config file settings in particular.""" |
