Skip to content

Commit e35067c

Browse files
KyleKinghukkin
andauthored
Apply suggestions from code review
Co-authored-by: Taneli Hukkinen <[email protected]>
1 parent 71721f4 commit e35067c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/mdformat/_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ def make_arg_parser(
203203
)
204204
parser.add_argument(
205205
"--no-validate",
206-
action="store_false",
206+
action="store_const",
207+
const=False,
207208
dest="validate",
208-
default=None,
209209
help="do not validate that the rendered HTML is consistent",
210210
)
211211
version_str = f"mdformat {mdformat.__version__}"

tests/test_config_file.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from io import StringIO
22
import sys
33
from unittest import mock
4-
from unittest.mock import patch
54

65
import pytest
76

@@ -158,7 +157,7 @@ def test_conf_no_validate(tmp_path):
158157
content = "1. ordered"
159158
file_path.write_text(content)
160159

161-
with patch("mdformat.renderer._context.get_list_marker_type", return_value="?"):
160+
with mock.patch("mdformat.renderer._context.get_list_marker_type", return_value="?"):
162161
assert run_with_clear_cache((str(file_path),)) == 1
163162
assert file_path.read_text() == content
164163

0 commit comments

Comments
 (0)