Shorten docstring for warn_about_none_ast
This commit is contained in:
parent
41031fce2f
commit
7a7ad0c120
|
@ -878,16 +878,10 @@ class AssertionRewriter(ast.NodeVisitor):
|
||||||
return self.statements
|
return self.statements
|
||||||
|
|
||||||
def warn_about_none_ast(self, node, module_path, lineno):
|
def warn_about_none_ast(self, node, module_path, lineno):
|
||||||
"""Returns an ast warning if node is None with the following statement:
|
"""
|
||||||
if node is None:
|
Returns an ast issuing a warning if the value of node is `None`
|
||||||
from _pytest.warning_types import PytestWarning
|
This is used to warn the user when asserting a function that asserts internally.
|
||||||
import warnings
|
See issue #3191 for more details
|
||||||
warnings.warn_explicit(
|
|
||||||
PytestWarning('assertion the value None, Please use "assert is None"'),
|
|
||||||
category=None,
|
|
||||||
filename=str,
|
|
||||||
lineno=node.lineno,
|
|
||||||
)
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# using parse because it's different between py2 py3
|
# using parse because it's different between py2 py3
|
||||||
|
|
Loading…
Reference in New Issue