/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): Gustav Hartvigsson
  • Date: 2021-01-10 18:46:30 UTC
  • mfrom: (7526.1.1 brz-removed-api-doc)
  • mto: This revision was merged to the branch mainline in revision 7532.
  • Revision ID: breezy.the.bot@gmail.com-20210110184630-dxu0g9dqq020uiw6
Drop documentation for removed API API.

Merged from https://code.launchpad.net/~gustav-hartvigsson/brz/removed-api-doc/+merge/396033

Show diffs side-by-side

added added

removed removed

Lines of Context:
325
325
            self.fail('\n\n'.join(problems))
326
326
 
327
327
    def test_flake8(self):
328
 
        self.requireFeature(features.flake8)
 
328
        try:
 
329
            self.requireFeature(features.flake8)
 
330
        except (SyntaxError, NameError):
 
331
            # importlib_metadata uses ModuleNotFoundError, which is
 
332
            # python 3.6 only
 
333
            if sys.version_info[:2] <= (3, 5):
 
334
                self.skipTest('python version too old')
 
335
            raise
329
336
        # Older versions of flake8 don't support the 'paths'
330
337
        # variable
331
338
        new_path = list(sys.path)
332
339
        new_path.insert(
333
340
            0, os.path.join(os.path.dirname(__file__), '..', '..', 'tools'))
334
341
        self.overrideAttr(sys, 'path', new_path)
 
342
        import argparse
335
343
        from flake8.main.application import Application
336
344
        from flake8.formatting.base import BaseFormatter
337
345
        app = Application()
352
360
            def handle(self, error):
353
361
                self.errors.append(error)
354
362
 
 
363
        try:
 
364
            app.initialize([])
 
365
        except argparse.ArgumentError as e:
 
366
            self.skipTest('broken flake8: %r' % e)
355
367
        app.formatter = Formatter()
356
 
        app.initialize([])
357
368
        app.run_checks()
358
369
        app.report()
359
370
        self.assertEqual(app.formatter.errors, [])