Skip to content

Commit

Permalink
test: simulate the failure from issue #1481
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Oct 28, 2022
1 parent b53db01 commit 89aabf3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_config.py
Expand Up @@ -230,6 +230,7 @@ def test_environment_vars_in_config(self):
assert cov.config.branch is True
assert cov.config.exclude_list == ["the_$one", "anotherZZZ", "xZZZy", "xy", "huh${X}what"]

@pytest.mark.xfail(reason="updated to demonstrate bug #1481")
def test_environment_vars_in_toml_config(self):
# Config files can have $envvars in them.
self.make_file("pyproject.toml", """\
Expand All @@ -244,10 +245,13 @@ def test_environment_vars_in_toml_config(self):
"x${NOTHING}y",
"huh$${X}what",
]
[othersection]
something = "if [ $OTHER ]; then printf '%s\\n' 'Hi'; fi"
""")
self.set_environ("BRANCH", "true")
self.set_environ("DATA_FILE", "hello-world")
self.set_environ("THING", "ZZZ")
self.set_environ("OTHER", "hi\\zebra")
cov = coverage.Coverage()
assert cov.config.data_file == "hello-world.fooey"
assert cov.config.branch is True
Expand Down

0 comments on commit 89aabf3

Please sign in to comment.