Fix some warnings from tests.

This commit is contained in:
Andrew Hamilton 2019-09-02 14:11:35 +10:00
parent 172e9d2978
commit a0a5e013fe
3 changed files with 5 additions and 5 deletions

View file

@ -37,12 +37,12 @@ def _indentation_of_line(line):
def _is_start_line_of_signature(line):
return re.match("^\s*(async)?\s*def\s", line) is not None
return re.match(r"^\s*(async)?\s*def\s", line) is not None
def _is_end_line_of_signature(line):
return (re.match(".*\):\s*\n$", line) is not None or
re.match(".*\):\s*#.*\n$", line) is not None)
return (re.match(r".*\):\s*\n$", line) is not None or
re.match(r".*\):\s*#.*\n$", line) is not None)
def gut_module(module_contents):

View file

@ -238,7 +238,7 @@ class MainTestCase(unittest.TestCase):
second_dir = os.path.join(temp_dir, "second")
os.rename(first_dir, second_dir)
test_run(second_dir, loop)
loop.close()
loop.stop()
finally:
shutil.rmtree(temp_dir)

View file

@ -124,7 +124,7 @@ class ToolsTestCase(unittest.TestCase):
def test_python_modulefinder(self):
self._test_tool(tools.python_modulefinder, self.HI_NORMAL)
def test_python_mccable(self):
def test_python_mccabe(self):
self._test_tool(tools.python_mccabe, self.HI_OK)
# FIX: Make the golden-file deterministic