/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: Jelmer Vernooij
  • Date: 2020-05-06 02:13:25 UTC
  • mfrom: (7490.7.21 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200506021325-awbmmqu1zyorz7sj
Merge 3.1 branch.

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
25
from . import (
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
46
44
        from breezy import tests
47
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,