/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: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

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
 
23
25
import os
24
26
 
25
27
from . import (
35
37
    takes_args = ['infile']
36
38
    takes_options = [
37
39
        option.Option('null-output',
38
 
                      help='Null command outputs match any output.'),
 
40
                       help='Null command outputs match any output.'),
39
41
        ]
40
42
 
41
43
    @commands.display_command
44
46
        from breezy import tests
45
47
        from breezy.tests.script import TestCaseWithTransportAndScript
46
48
 
47
 
        with open(infile) as f:
 
49
        f = open(infile)
 
50
        try:
48
51
            script = f.read()
 
52
        finally:
 
53
            f.close()
49
54
 
50
55
        class Test(TestCaseWithTransportAndScript):
51
56
 
52
 
            script = None  # Set before running
 
57
            script = None # Set before running
53
58
 
54
59
            def test_it(self):
55
60
                self.run_script(script,