Address code review
This commit is contained in:
parent
e1e4b226c6
commit
41031fce2f
|
@ -10,7 +10,8 @@ When they should write::
|
|||
|
||||
Because the ``assert_called_with`` method of mock objects already executes an assertion.
|
||||
|
||||
This warning will not be issued when ``None`` is explicitly checked
|
||||
assert none_returning_fun() is None
|
||||
This warning will not be issued when ``None`` is explicitly checked. An assertion like::
|
||||
|
||||
assert variable is None
|
||||
|
||||
will not issue the warning
|
||||
|
|
|
@ -885,8 +885,7 @@ class AssertionRewriter(ast.NodeVisitor):
|
|||
warnings.warn_explicit(
|
||||
PytestWarning('assertion the value None, Please use "assert is None"'),
|
||||
category=None,
|
||||
# filename=str(self.module_path),
|
||||
filename=__file__
|
||||
filename=str,
|
||||
lineno=node.lineno,
|
||||
)
|
||||
"""
|
||||
|
@ -905,7 +904,7 @@ warn_explicit(
|
|||
lineno={lineno},
|
||||
)
|
||||
""".format(
|
||||
filename=str(module_path), lineno=lineno
|
||||
filename=module_path.strpath, lineno=lineno
|
||||
)
|
||||
).body
|
||||
return ast.If(val_is_none, send_warning, [])
|
||||
|
|
Loading…
Reference in New Issue