Address code review

This commit is contained in:
Tomer Keren 2018-12-05 17:18:57 +02:00
parent e1e4b226c6
commit 41031fce2f
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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, [])