Skip to content

Commit

Permalink
Ignoring test_* functions
Browse files Browse the repository at this point in the history
  • Loading branch information
choucavalier committed Jul 30, 2018
1 parent b2e667d commit e3fa4b8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions npdocstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def get_funclassdef_nodes(file_content) -> List[ast.AST]:

for node in ast.iter_child_nodes(root):
if type(node) in [FunctionDef, AsyncFunctionDef, ClassDef]:
if node.name.startswith('__') and node.name.endswith('__'):
if (
(node.name.startswith('__') and node.name.endswith('__')) or
node.name.startswith('test_')
):
continue
if ast.get_docstring(node) is None:
fcnodes.append(node)
Expand Down Expand Up @@ -123,8 +126,9 @@ def node_to_str(node: ast.AST) -> str:
return 'FIXME'


def get_function_arguments(node: Union[FunctionDef, AsyncFunctionDef]
) -> List[AtrOrArg]:
def get_function_arguments(
node: Union[FunctionDef, AsyncFunctionDef]
) -> List[AtrOrArg]:

arguments = []

Expand Down

0 comments on commit e3fa4b8

Please sign in to comment.