diff --git a/tests/test_config_flag_proselintrc.json b/tests/test-proselintrc.json similarity index 100% rename from tests/test_config_flag_proselintrc.json rename to tests/test-proselintrc.json diff --git a/tests/test_config_flag.py b/tests/test_config_flag.py index 63306b79c..6d082f34f 100644 --- a/tests/test_config_flag.py +++ b/tests/test_config_flag.py @@ -13,7 +13,7 @@ runner = CliRunner() -CONFIG_FILE = Path(__file__, "../test_config_flag_proselintrc.json").resolve() +CONFIG_FILE = str(Path(__file__, "../test-proselintrc.json").resolve()) def test_deepmerge_dicts(): @@ -27,7 +27,7 @@ def test_deepmerge_dicts(): def test_load_options_function(isfile): """Test load_options by specifying a user options path""" - isfile.side_effect = str(CONFIG_FILE).__eq__ + isfile.side_effect = CONFIG_FILE.__eq__ overrides = load_options(CONFIG_FILE, default) assert load_options(conf_default=default)["checks"]["uncomparables.misc"] @@ -43,8 +43,9 @@ def test_config_flag(): output = runner.invoke(proselint, "--demo") assert "uncomparables.misc" in output.stdout - output = runner.invoke(proselint, f"--demo --config {CONFIG_FILE}") + output = runner.invoke(proselint, f"--demo --config '{CONFIG_FILE}'") assert "uncomparables.misc" not in output.stdout + assert "FileNotFoundError" != output.exc_info[0].__name__ output = runner.invoke(proselint, "--demo --config non_existent_file") assert output.exit_code == 1 @@ -59,5 +60,5 @@ def test_dump_config(): output = runner.invoke(proselint, "--dump-default-config") assert json.loads(output.stdout) == default - output = runner.invoke(proselint, f"--dump-config --config {CONFIG_FILE}") + output = runner.invoke(proselint, f"--dump-config --config '{CONFIG_FILE}'") assert json.loads(output.stdout) == json.load(open(CONFIG_FILE))