Skip to content

Commit ddd42ca

Browse files
committed
test: add patch to unit test
1 parent b52fd27 commit ddd42ca

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/test_cli.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -345,19 +345,17 @@ def test_eol__check_keep_crlf(tmp_path):
345345
assert run((str(file_path), "--check", "--end-of-line=keep")) == 1
346346

347347

348-
@pytest.mark.skip
349348
def test_no_validate(tmp_path):
350-
# FIXME: Fake an mdformat bug that renders to a different HTML
349+
with patch("mdformat.renderer._context.get_list_marker_type", return_value="?"):
350+
file_path = tmp_path / "test.md"
351+
content = "1. ordered"
352+
file_path.write_text(content)
351353

352-
file_path = tmp_path / "test.md"
353-
content = "2. ordered"
354-
file_path.write_text(content)
355-
356-
assert run((str(file_path),)) == 1
357-
assert file_path.read_text() == content
354+
assert run((str(file_path),)) == 1
355+
assert file_path.read_text() == content
358356

359-
assert run((str(file_path), "--no-validate")) == 0
360-
assert file_path.read_text() != content
357+
assert run((str(file_path), "--no-validate")) == 0
358+
assert file_path.read_text() == "1? ordered\n"
361359

362360

363361
def test_get_plugin_info_str():

0 commit comments

Comments
 (0)