Skip to content

Commit d33147b

Browse files
committed
Improve coverage
1 parent 7c6ee58 commit d33147b

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

tests/test_config.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77
from tests.conftest import get_version, get_version_setup_py, create_file, create_pyproject_toml, create_setup_py
88

99

10-
def test_config_not_used(repo):
10+
def test_config_not_set(repo, create_config):
11+
create_config(repo, NotImplemented)
12+
13+
assert get_version(repo) == "0.0.0"
14+
15+
16+
@pytest.mark.parametrize(
17+
"option",
18+
["version_config", "setuptools_git_versioning"],
19+
)
20+
def test_config_not_used(repo, option):
1121
create_file(
1222
repo,
1323
"setup.py",
@@ -23,12 +33,13 @@ def test_config_not_used(repo):
2333
2434
setuptools.setup(
2535
name="mypkg",
36+
{option}=None,
2637
)
2738
finally:
2839
coverage.stop()
2940
coverage.save()
3041
"""
31-
),
42+
).format(option=option),
3243
)
3344

3445
cfg = {
@@ -53,16 +64,6 @@ def test_config_not_used(repo):
5364
assert get_version(repo, isolated=True) == "0.0.0"
5465

5566

56-
@pytest.mark.parametrize(
57-
"option",
58-
["version_config", "setuptools_git_versioning"],
59-
)
60-
def test_config_not_set(repo, create_config, option):
61-
create_config(repo, NotImplemented, option=option)
62-
63-
assert get_version(repo) == "0.0.0"
64-
65-
6667
@pytest.mark.parametrize(
6768
"option",
6869
["version_config", "setuptools_git_versioning"],

0 commit comments

Comments
 (0)