diff --git a/tests/test_config.py b/tests/test_config.py index 4a9a9075..7a4902d1 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -147,6 +147,27 @@ def test_config_merging_missing(): assert result["ignore_names"] == ["name1"] +def test_config_merging_toml_paths_only(): + """ + If we have paths in the TOML but not on the CLI, the TOML paths should be + used. + """ + toml = StringIO( + dedent( + """\ + [tool.vulture] + paths = ["path1", "path2"] + """ + ) + ) + cliargs = [ + "--exclude=test_*.py" + ] + result = make_config(cliargs, toml) + assert result["paths"] == ["path1", "path2"] + assert result["exclude"] == ["test_*.py"] + + def test_invalid_config_options_output(): """ If the config file contains unknown options we want to abort. diff --git a/vulture/config.py b/vulture/config.py index 45ae0c38..a9a222e8 100644 --- a/vulture/config.py +++ b/vulture/config.py @@ -100,6 +100,7 @@ def csv(exclude): "paths", nargs="*", metavar="PATH", + default=missing, help="Paths may be Python files or directories. For each directory" " Vulture analyzes all contained *.py files.", )