Fix typo in magnum/hacking/checks.py for consistency
Change-Id: I0396ed22d8864c4e125d4bf4f592b53b93ded6ee
This commit is contained in:
parent
37093b2436
commit
8baedc2b72
4
magnum/hacking/checks.py
Normal file → Executable file
4
magnum/hacking/checks.py
Normal file → Executable file
@ -38,7 +38,7 @@ assert_equal_in_end_with_true_or_false_re = re.compile(
|
|||||||
r"assertEqual\((\w|[][.'\"])+ in (\w|[][.'\", ])+, (True|False)\)")
|
r"assertEqual\((\w|[][.'\"])+ in (\w|[][.'\", ])+, (True|False)\)")
|
||||||
assert_equal_in_start_with_true_or_false_re = re.compile(
|
assert_equal_in_start_with_true_or_false_re = re.compile(
|
||||||
r"assertEqual\((True|False), (\w|[][.'\"])+ in (\w|[][.'\", ])+\)")
|
r"assertEqual\((True|False), (\w|[][.'\"])+ in (\w|[][.'\", ])+\)")
|
||||||
asse_equal_with_is_not_none_re = re.compile(
|
assert_equal_with_is_not_none_re = re.compile(
|
||||||
r"assertEqual\(.*?\s+is+\s+not+\s+None\)$")
|
r"assertEqual\(.*?\s+is+\s+not+\s+None\)$")
|
||||||
assert_true_isinstance_re = re.compile(
|
assert_true_isinstance_re = re.compile(
|
||||||
r"(.)*assertTrue\(isinstance\((\w|\.|\'|\"|\[|\])+, "
|
r"(.)*assertTrue\(isinstance\((\w|\.|\'|\"|\[|\])+, "
|
||||||
@ -71,7 +71,7 @@ def no_mutable_default_args(logical_line):
|
|||||||
def assert_equal_not_none(logical_line):
|
def assert_equal_not_none(logical_line):
|
||||||
"""Check for assertEqual(A is not None) sentences M302"""
|
"""Check for assertEqual(A is not None) sentences M302"""
|
||||||
msg = "M302: assertEqual(A is not None) sentences not allowed."
|
msg = "M302: assertEqual(A is not None) sentences not allowed."
|
||||||
res = asse_equal_with_is_not_none_re.search(logical_line)
|
res = assert_equal_with_is_not_none_re.search(logical_line)
|
||||||
if res:
|
if res:
|
||||||
yield (0, msg)
|
yield (0, msg)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user