File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import typer
44
55from usethis ._config import quiet_opt , usethis_config
6- from usethis ._config_file import files_manager
76from usethis ._core .docstyle import UnknownDocstringStyleError , use_docstyle
87
98
@@ -18,5 +17,5 @@ def docstyle(
1817 msg = f"Invalid docstring style: { style } . Choose from 'numpy', 'google', or 'pep257'."
1918 raise UnknownDocstringStyleError (msg )
2019
21- with usethis_config .set (quiet = quiet ), files_manager () :
20+ with usethis_config .set (quiet = quiet ):
2221 use_docstyle (style )
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+
3+ import pytest
4+
5+ from usethis ._config_file import files_manager
6+ from usethis ._interface .docstyle import docstyle
7+ from usethis ._test import change_cwd
8+
9+
10+ class TestDocstyle :
11+ def test_invalid_style (self ):
12+ with pytest .raises (ValueError , match = "Invalid docstring style" ):
13+ docstyle ("invalid_style" )
14+
15+ def test_google_runs (self , tmp_path : Path ):
16+ with change_cwd (tmp_path ), files_manager ():
17+ docstyle ("google" )
You can’t perform that action at this time.
0 commit comments