~brz/brz/3.0

« back to all changes in this revision

Viewing changes to breezy/tests/test_source.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-05-30 01:35:40 UTC
  • mfrom: (7340.1.9 flakes-fix)
  • Revision ID: breezy.the.bot@gmail.com-20200530013540-g5thcq7ltuijo83k
Fix compatibility with newer versions of flake8.

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

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
        import argparse
335
336
        from flake8.main.application import Application
336
337
        from flake8.formatting.base import BaseFormatter
337
338
        app = Application()
352
353
            def handle(self, error):
353
354
                self.errors.append(error)
354
355
 
 
356
        try:
 
357
            app.initialize([])
 
358
        except argparse.ArgumentError as e:
 
359
            self.skipTest('broken flake8: %r' % e)
355
360
        app.formatter = Formatter()
356
 
        app.initialize([])
357
361
        app.run_checks()
358
362
        app.report()
359
363
        self.assertEqual(app.formatter.errors, [])