/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/cmd_test_script.py

  • Committer: Breezy landing bot
  • Author(s): Colin Watson
  • Date: 2020-11-16 21:47:08 UTC
  • mfrom: (7521.1.1 remove-lp-workaround)
  • Revision ID: breezy.the.bot@gmail.com-20201116214708-jos209mgxi41oy15
Remove breezy.git workaround for bazaar.launchpad.net.

Merged from https://code.launchpad.net/~cjwatson/brz/remove-lp-workaround/+merge/393710

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
This module should be importable even if testtools aren't available.
21
21
"""
22
22
 
23
 
from __future__ import absolute_import
24
 
 
25
23
import os
26
24
 
27
 
from bzrlib import (
 
25
from . import (
28
26
    commands,
29
27
    option,
30
28
    )
37
35
    takes_args = ['infile']
38
36
    takes_options = [
39
37
        option.Option('null-output',
40
 
                       help='Null command outputs match any output.'),
 
38
                      help='Null command outputs match any output.'),
41
39
        ]
42
40
 
43
41
    @commands.display_command
44
42
    def run(self, infile, null_output=False):
45
43
        # local imports to defer testtools dependency
46
 
        from bzrlib import tests
47
 
        from bzrlib.tests.script import TestCaseWithTransportAndScript
 
44
        from breezy import tests
 
45
        from breezy.tests.script import TestCaseWithTransportAndScript
48
46
 
49
 
        f = open(infile)
50
 
        try:
 
47
        with open(infile) as f:
51
48
            script = f.read()
52
 
        finally:
53
 
            f.close()
54
49
 
55
50
        class Test(TestCaseWithTransportAndScript):
56
51
 
57
 
            script = None # Set before running
 
52
            script = None  # Set before running
58
53
 
59
54
            def test_it(self):
60
55
                self.run_script(script,