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
|
||||
|
||||
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:
|
||||
from _pytest.warning_types import PytestWarning
|
||||
import warnings
|
||||
warnings.warn_explicit(
|
||||
PytestWarning('assertion the value None, Please use "assert is None"'),
|
||||
category=None,
|
||||
filename=str,
|
||||
lineno=node.lineno,
|
||||
)
|
||||
"""
|
||||
Returns an ast issuing a warning if the value of node is `None`
|
||||
This is used to warn the user when asserting a function that asserts internally.
|
||||
See issue #3191 for more details
|
||||
"""
|
||||
|
||||
# using parse because it's different between py2 py3
|
||||
|
|
Loading…
Reference in New Issue