/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_source.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-05-28 20:24:00 UTC
  • mfrom: (7296.1.4 fix-sphinx)
  • Revision ID: breezy.the.bot@gmail.com-20190528202400-lwfbjx99w4awut59
Set PATH correctly so pip-installed sphinx is found; fix compatibility with newer versions of Dulwich.

Merged from https://code.launchpad.net/~jelmer/brz/fix-sphinx/+merge/367949

Show diffs side-by-side

added added

removed removed

Lines of Context:
332
332
        new_path.insert(
333
333
            0, os.path.join(os.path.dirname(__file__), '..', '..', 'tools'))
334
334
        self.overrideAttr(sys, 'path', new_path)
335
 
        from flake8.api import legacy as flake8
336
 
        style_guide = flake8.get_style_guide(config=u'setup.cfg', jobs="1")
337
 
        report = style_guide.check_files(list(self.get_source_files()))
338
 
        self.assertEqual([], report.get_statistics(''))
 
335
        from flake8.main.application import Application
 
336
        from flake8.formatting.base import BaseFormatter
 
337
        app = Application()
 
338
        app.config = u'setup.cfg'
 
339
        app.jobs = 1
 
340
 
 
341
        class Formatter(BaseFormatter):
 
342
 
 
343
            def __init__(self):
 
344
                self.errors = []
 
345
 
 
346
            def start(self):
 
347
                pass
 
348
 
 
349
            def stop(self):
 
350
                app.file_checker_manager.report()
 
351
 
 
352
            def handle(self, error):
 
353
                self.errors.append(error)
 
354
 
 
355
        app.formatter = Formatter()
 
356
        app.initialize([])
 
357
        app.run_checks()
 
358
        app.report()
 
359
        self.assertEqual(app.formatter.errors, [])
339
360
 
340
361
    def test_no_asserts(self):
341
362
        """bzr shouldn't use the 'assert' statement."""