diff --git a/tests/test-proselintrc.json b/tests/test-proselintrc.json index c77d0c735..362767f9a 100644 --- a/tests/test-proselintrc.json +++ b/tests/test-proselintrc.json @@ -60,6 +60,7 @@ "nonwords.misc" : true, "oxymorons.misc" : true, "psychology.misc" : true, + "punctuation_spacing.misc" : true, "redundancy.misc" : true, "redundancy.ras_syndrome" : true, "skunked_terms.misc" : true, diff --git a/tests/test_config_flag.py b/tests/test_config_flag.py index c585a1287..00e6294d1 100644 --- a/tests/test_config_flag.py +++ b/tests/test_config_flag.py @@ -22,28 +22,27 @@ def test_deepmerge_dicts(): d2 = {"a": 2, "b": {"c": 3, "e": 4}} assert _deepmerge_dicts(d1, d2) == {"a": 2, "b": {"c": 3, "d": 3, "e": 4}} - @patch("os.path.isfile") def test_load_options_function(isfile): """Test load_options by specifying a user options path""" isfile.side_effect = CONFIG_FILE.__eq__ overrides = load_options(CONFIG_FILE) - assert load_options()["checks"]["uncomparables.misc"] + default = load_options() + assert default == proselint_base + assert default["checks"]["uncomparables.misc"] assert not overrides["checks"]["uncomparables.misc"] - isfile.side_effect = os.path.join(os.getcwd(), ".proselintrc").__eq__ - - assert load_options() == default + isfile.side_effect = os.path.join(os.getcwd(), ".proselintrc.json").__eq__ def test_config_flag_demo(): """Test the --config CLI argument""" - result = CliRunner().invoke(proselint, ["--demo"]) + result = CliRunner().invoke(proselint, ["--demo", "-v"]) print_invoke_return(result) assert "uncomparables.misc" in result.stdout def test_config_flag_config(): - result = runner.invoke(proselint, ["--demo", "--debug"] + FLAG) + result = CliRunner().invoke(proselint, ["--demo", "-v"] + FLAG) print_invoke_return(result) assert "uncomparables.misc" not in result.stdout @@ -70,6 +69,6 @@ def test_dump_config(): if triggered, the input-cfg was extended with the default-config -> add missing flags to input-cfg! """ - output = runner.invoke(proselint, ["--dump-config"] + FLAG) + output = CliRunner().invoke(proselint, ["--dump-config"] + FLAG) assert json.loads(output.stdout) == json.load(CONFIG_FILE.open()) diff --git a/tests/test_invalid_chars.py b/tests/test_invalid_chars.py index 760ffb158..a17f16243 100644 --- a/tests/test_invalid_chars.py +++ b/tests/test_invalid_chars.py @@ -14,10 +14,9 @@ def test_invalid_characters(): """Ensure that invalid characters do not break proselint.""" runner = CliRunner() - result = runner.invoke(proselint, CHAR_FILE) + result = runner.invoke(proselint, CHAR_FILE.as_posix()) print_invoke_return(result) - assert len(result.stdout) > 0 assert result.exit_code == 0 assert "UnicodeDecodeError" not in result.stdout assert "FileNotFoundError" not in result.stdout