329
329
# lazy_regex compile objects.
330
330
from .. import lazy_regex
331
331
lazy_regex.reset_compile()
333
self.requireFeature(features.flake8)
334
# Older versions of flake8 don't support the 'paths'
336
new_path = list(sys.path)
338
0, os.path.join(os.path.dirname(__file__), '..', '..', 'tools'))
339
self.overrideAttr(sys, 'path', new_path)
340
from flake8.api import legacy as flake8
341
style_guide = flake8.get_style_guide(config=u'setup.cfg', jobs="1")
342
report = style_guide.check_files(list(self.get_source_files()))
343
self.assertEqual([], report.get_statistics(''))
345
lazy_regex.install_lazy_compile()
332
self.addCleanup(lazy_regex.install_lazy_compile)
333
self.requireFeature(features.flake8)
334
# Older versions of flake8 don't support the 'paths'
336
new_path = list(sys.path)
338
0, os.path.join(os.path.dirname(__file__), '..', '..', 'tools'))
339
self.overrideAttr(sys, 'path', new_path)
340
from flake8.api import legacy as flake8
341
style_guide = flake8.get_style_guide(config=u'setup.cfg', jobs="1")
342
report = style_guide.check_files(list(self.get_source_files()))
343
self.assertEqual([], report.get_statistics(''))
347
345
def test_no_asserts(self):
348
346
"""bzr shouldn't use the 'assert' statement."""