MCPcopy
hub / github.com/pandas-dev/pandas / is_misnamed_test_func

Function is_misnamed_test_func

scripts/check_test_naming.py:53–64  ·  view source on GitHub ↗
(
    node: ast.expr | ast.stmt, names: Sequence[str], line: str
)

Source from the content-addressed store, hash-verified

51
52
53def is_misnamed_test_func(
54 node: ast.expr | ast.stmt, names: Sequence[str], line: str
55) -> bool:
56 return (
57 isinstance(node, ast.FunctionDef)
58 and not node.name.startswith("test")
59 and names.count(node.name) == 0
60 and not any(_is_fixture(decorator) for decorator in node.decorator_list)
61 and PRAGMA not in line
62 and node.name
63 not in ("teardown_method", "setup_method", "teardown_class", "setup_class")
64 )
65
66
67def is_misnamed_test_class(

Callers 1

mainFunction · 0.85

Calls 3

_is_fixtureFunction · 0.85
startswithMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected