Only skip a file if # flake8: noqa is on a line by itself

This commit is contained in:
Anthony Sottile 2017-12-20 12:43:45 -08:00
parent eb6228b660
commit e73055432c
2 changed files with 13 additions and 4 deletions

View file

@ -46,6 +46,7 @@ def test_strip_utf_bom(first_line):
(['#!/usr/bin/python', '# flake8: noqa', 'a = 1'], True),
(['# flake8: noqa', '#!/usr/bin/python', 'a = 1'], True),
(['#!/usr/bin/python', 'a = 1', '# flake8: noqa'], True),
(['#!/usr/bin/python', 'a = 1 # flake8: noqa'], False),
])
def test_should_ignore_file(lines, expected):
"""Verify that we ignore a file if told to."""