Skip to content

Commit d7cdec6

Browse files
committed
test(test_validate_hook.py): modify test strings and remove unused os.sep replacement
Updates to make this PR compatible with the recent merge from #653
1 parent acb3f89 commit d7cdec6

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ jobs:
4848
4949
- name: Run test suite
5050
run: |
51-
pytest -v --pyargs numpydoc
52-
pytest -v --pyargs numpydoc/tests/hooks
51+
pytest -v --pyargs .
5352
5453
- name: Test coverage
5554
run: |
@@ -101,8 +100,7 @@ jobs:
101100
102101
- name: Run test suite
103102
run: |
104-
pytest -v --pyargs numpydoc
105-
pytest -v --pyargs numpydoc/tests/hooks
103+
pytest -v --pyargs .
106104
107105
- name: Test coverage
108106
run: |

numpydoc/tests/hooks/test_validate_hook.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ def test_validate_hook(example_module, config, capsys):
7373
7474
{example_module!s}:58: ES01 No extended summary found
7575
76-
{example_module!s}:58: PR01 Parameters {"name"} not documented
76+
{example_module!s}:58: PR01 Parameters {{'name'}} not documented
7777
7878
{example_module!s}:58: SA01 See Also section not found
7979
8080
{example_module!s}:58: EX01 No examples section found
8181
"""
82-
).replace("/", os.sep)
82+
)
8383

8484
return_code = run_hook([example_module], config=config)
8585
assert return_code == 1
@@ -106,9 +106,9 @@ def test_validate_hook_with_ignore(example_module, capsys):
106106
107107
{example_module!s}:30: GL08 The object does not have a docstring
108108
109-
{example_module!s}:58: PR01 Parameters {"name"} not documented
109+
{example_module!s}:58: PR01 Parameters {{'name'}} not documented
110110
"""
111-
).replace("/", os.sep)
111+
)
112112

113113
return_code = run_hook([example_module], ignore=["ES01", "SA01", "EX01"])
114114

@@ -151,7 +151,7 @@ def test_validate_hook_with_toml_config(example_module, tmp_path, capsys):
151151
152152
{example_module!s}:30: GL08 The object does not have a docstring
153153
"""
154-
).replace("/", os.sep)
154+
)
155155

156156
return_code = run_hook([example_module], config=tmp_path)
157157
assert return_code == 1
@@ -186,7 +186,7 @@ def test_validate_hook_with_setup_cfg(example_module, tmp_path, capsys):
186186
187187
{example_module!s}:30: GL08 The object does not have a docstring
188188
"""
189-
).replace("/", os.sep)
189+
)
190190

191191
return_code = run_hook([example_module], config=tmp_path)
192192
assert return_code == 1
@@ -227,7 +227,7 @@ def test_validate_hook_exclude_option_pyproject(example_module, tmp_path, capsys
227227
228228
{example_module!s}:30: GL08 The object does not have a docstring
229229
"""
230-
).replace("/", os.sep)
230+
)
231231

232232
return_code = run_hook([example_module], config=tmp_path)
233233
assert return_code == 1
@@ -260,7 +260,7 @@ def test_validate_hook_exclude_option_setup_cfg(example_module, tmp_path, capsys
260260
261261
{example_module!s}:17: PR07 Parameter "*args" has no description
262262
"""
263-
).replace("/", os.sep)
263+
)
264264

265265
return_code = run_hook([example_module], config=tmp_path)
266266
assert return_code == 1

0 commit comments

Comments
 (0)