/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_strace.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:
49
49
        # strace itself is fixed (bug #103133), we can get rid of the
50
50
        # restriction.
51
51
        active = threading.activeCount()
52
 
        if active > 1:  # There is always the main thread at least
 
52
        if active > 1: # There is always the main thread at least
53
53
            self.knownFailure(
54
54
                '%d active threads, bug #103133 needs to be fixed.' % active)
55
55
 
68
68
        self._check_threads()
69
69
 
70
70
        output = []
71
 
 
72
71
        def function(positional, *args, **kwargs):
73
72
            output.append((positional, args, kwargs))
74
73
        self.strace_detailed_or_skip(
75
74
            function, ["a", "b"], {"c": "c"},
76
75
            follow_children=False)
77
 
        self.assertEqual([("a", ("b",), {"c": "c"})], output)
 
76
        self.assertEqual([("a", ("b",), {"c":"c"})], output)
78
77
 
79
78
    def test_strace_callable_result(self):
80
79
        self._check_threads()
81
80
 
82
81
        def function():
83
82
            return "foo"
84
 
        result, strace_result = self.strace_detailed_or_skip(function, [], {},
85
 
                                                             follow_children=False)
 
83
        result, strace_result = self.strace_detailed_or_skip(function,[], {},
 
84
                                                follow_children=False)
86
85
        self.assertEqual("foo", result)
87
86
        self.assertIsInstance(strace_result, StraceResult)
88
87
 
93
92
        def function():
94
93
            self.build_tree(['myfile'])
95
94
        unused, result = self.strace_detailed_or_skip(function, [], {},
96
 
                                                      follow_children=False)
 
95
                                         follow_children=False)
97
96
        self.assertContainsRe(result.raw_log, 'myfile')