Merge lp:~vila/bzr/thou-shall-use-testcaseintempdir into lp:bzr
- thou-shall-use-testcaseintempdir
- Merge into bzr.dev
Status: | Merged |
---|---|
Approved by: | Martin Packman |
Approved revision: | no longer in the source branch. |
Merged at revision: | 6553 |
Proposed branch: | lp:~vila/bzr/thou-shall-use-testcaseintempdir |
Merge into: | lp:bzr |
Diff against target: |
772 lines (+65/-76) 39 files modified
bzrlib/plugins/launchpad/test_lp_api.py (+1/-1) bzrlib/plugins/launchpad/test_lp_directory.py (+1/-1) bzrlib/tests/blackbox/test_init.py (+1/-1) bzrlib/tests/blackbox/test_inventory.py (+1/-1) bzrlib/tests/blackbox/test_push.py (+1/-1) bzrlib/tests/per_branch/test_hooks.py (+1/-1) bzrlib/tests/per_interbranch/test_pull.py (+1/-1) bzrlib/tests/per_interbranch/test_push.py (+1/-1) bzrlib/tests/per_merger.py (+1/-1) bzrlib/tests/per_tree/test_inv.py (+1/-1) bzrlib/tests/per_versionedfile.py (+2/-2) bzrlib/tests/per_workingtree/test_eol_conversion.py (+1/-1) bzrlib/tests/per_workingtree/test_views.py (+2/-2) bzrlib/tests/test_btree_index.py (+2/-2) bzrlib/tests/test_bugtracker.py (+3/-3) bzrlib/tests/test_commands.py (+1/-1) bzrlib/tests/test_directory_service.py (+1/-1) bzrlib/tests/test_dirstate.py (+1/-2) bzrlib/tests/test_generate_docs.py (+1/-1) bzrlib/tests/test_help.py (+1/-1) bzrlib/tests/test_http.py (+5/-4) bzrlib/tests/test_http_response.py (+1/-1) bzrlib/tests/test_ignores.py (+1/-1) bzrlib/tests/test_lazy_import.py (+2/-2) bzrlib/tests/test_lockable_files.py (+5/-5) bzrlib/tests/test_log.py (+2/-2) bzrlib/tests/test_merge.py (+1/-1) bzrlib/tests/test_osutils.py (+4/-4) bzrlib/tests/test_osutils_encodings.py (+2/-2) bzrlib/tests/test_pack.py (+1/-1) bzrlib/tests/test_remote.py (+1/-1) bzrlib/tests/test_revisionspec.py (+1/-1) bzrlib/tests/test_selftest.py (+5/-5) bzrlib/tests/test_sftp_transport.py (+3/-2) bzrlib/tests/test_smart.py (+2/-14) bzrlib/tests/test_smart_transport.py (+1/-1) bzrlib/tests/test_symbol_versioning.py (+1/-1) bzrlib/tests/test_wsgi.py (+1/-1) bzrlib/tests/test_xml.py (+1/-1) |
To merge this branch: | bzr merge lp:~vila/bzr/thou-shall-use-testcaseintempdir |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman (community) | Approve | ||
Review via email: mp+118074@code.launchpad.net |
Commit message
Calling super() instead of mentioning the base class in setUp avoid mistakes.
Description of the change
Remember the annoying:
failed to open trace file: [Errno 13] Permission denied: '/you-should-
while running the test suite ?
I'm been wondering for quite some time where it was coming from with a gut
feeling that some test weren't using the right base class (as hinted by the
error message).
Guess what ? I was wrong, the culprit was:
class TestWSGI(
Huh ? It uses TestCaseInTempDir what the ... ?
def setUp(self):
Oooops.
Better use super() here, far safer.
Martin Packman (gz) wrote : | # |
Nothing else broken, though bt.test_
Vincent Ladeuil (vila) wrote : | # |
> Nothing else broken, though bt.test_
> robust thing ever.
Urgh, indeed, youth sin I guess, fixed in the next revision.
Vincent Ladeuil (vila) wrote : | # |
And this last revision get rid of the remaining tests where grep matched setup(self). There are only a few remaining matches that can may be be deleted but require more attention.
Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
Preview Diff
1 | === modified file 'bzrlib/plugins/launchpad/test_lp_api.py' |
2 | --- bzrlib/plugins/launchpad/test_lp_api.py 2011-07-11 07:02:20 +0000 |
3 | +++ bzrlib/plugins/launchpad/test_lp_api.py 2012-08-04 14:30:26 +0000 |
4 | @@ -34,7 +34,7 @@ |
5 | _test_needs_features = [launchpadlib_feature] |
6 | |
7 | def setUp(self): |
8 | - TestCase.setUp(self) |
9 | + super(TestDependencyManagement, self).setUp() |
10 | from bzrlib.plugins.launchpad import lp_api |
11 | self.lp_api = lp_api |
12 | |
13 | |
14 | === modified file 'bzrlib/plugins/launchpad/test_lp_directory.py' |
15 | --- bzrlib/plugins/launchpad/test_lp_directory.py 2012-01-20 13:07:10 +0000 |
16 | +++ bzrlib/plugins/launchpad/test_lp_directory.py 2012-08-04 14:30:26 +0000 |
17 | @@ -451,7 +451,7 @@ |
18 | server_class = None |
19 | |
20 | def setUp(self): |
21 | - tests.TestCase.setUp(self) |
22 | + super(TestXMLRPCTransport, self).setUp() |
23 | self.server = self.server_class() |
24 | self.server.start_server() |
25 | self.addCleanup(self.server.stop_server) |
26 | |
27 | === modified file 'bzrlib/tests/blackbox/test_init.py' |
28 | --- bzrlib/tests/blackbox/test_init.py 2011-12-21 16:26:24 +0000 |
29 | +++ bzrlib/tests/blackbox/test_init.py 2012-08-04 14:30:26 +0000 |
30 | @@ -36,7 +36,7 @@ |
31 | class TestInit(TestCaseWithTransport): |
32 | |
33 | def setUp(self): |
34 | - TestCaseWithTransport.setUp(self) |
35 | + super(TestInit, self).setUp() |
36 | self._default_label = '2a' |
37 | |
38 | def test_init_with_format(self): |
39 | |
40 | === modified file 'bzrlib/tests/blackbox/test_inventory.py' |
41 | --- bzrlib/tests/blackbox/test_inventory.py 2009-03-23 14:59:43 +0000 |
42 | +++ bzrlib/tests/blackbox/test_inventory.py 2012-08-04 14:30:26 +0000 |
43 | @@ -24,7 +24,7 @@ |
44 | class TestInventory(TestCaseWithTransport): |
45 | |
46 | def setUp(self): |
47 | - TestCaseWithTransport.setUp(self) |
48 | + super(TestInventory, self).setUp() |
49 | |
50 | tree = self.make_branch_and_tree('.') |
51 | self.build_tree(['a', 'b/', 'b/c']) |
52 | |
53 | === modified file 'bzrlib/tests/blackbox/test_push.py' |
54 | --- bzrlib/tests/blackbox/test_push.py 2012-07-04 18:02:31 +0000 |
55 | +++ bzrlib/tests/blackbox/test_push.py 2012-08-04 14:30:26 +0000 |
56 | @@ -683,7 +683,7 @@ |
57 | class TestPushRedirect(tests.TestCaseWithTransport): |
58 | |
59 | def setUp(self): |
60 | - tests.TestCaseWithTransport.setUp(self) |
61 | + super(TestPushRedirect, self).setUp() |
62 | self.memory_server = RedirectingMemoryServer() |
63 | self.start_server(self.memory_server) |
64 | # Make the branch and tree that we'll be pushing. |
65 | |
66 | === modified file 'bzrlib/tests/per_branch/test_hooks.py' |
67 | --- bzrlib/tests/per_branch/test_hooks.py 2012-03-14 13:34:43 +0000 |
68 | +++ bzrlib/tests/per_branch/test_hooks.py 2012-08-04 14:30:26 +0000 |
69 | @@ -294,7 +294,7 @@ |
70 | """ |
71 | |
72 | def setUp(self): |
73 | - ChangeBranchTipTestCase.setUp(self) |
74 | + super(TestAllMethodsThatChangeTipWillRunHooks, self).setUp() |
75 | self.installPreAndPostHooks() |
76 | |
77 | def installPreAndPostHooks(self): |
78 | |
79 | === modified file 'bzrlib/tests/per_interbranch/test_pull.py' |
80 | --- bzrlib/tests/per_interbranch/test_pull.py 2012-02-23 23:26:35 +0000 |
81 | +++ bzrlib/tests/per_interbranch/test_pull.py 2012-08-04 14:30:26 +0000 |
82 | @@ -125,7 +125,7 @@ |
83 | |
84 | def setUp(self): |
85 | self.hook_calls = [] |
86 | - TestCaseWithInterBranch.setUp(self) |
87 | + super(TestPullHook, self).setUp() |
88 | |
89 | def capture_post_pull_hook(self, result): |
90 | """Capture post pull hook calls to self.hook_calls. |
91 | |
92 | === modified file 'bzrlib/tests/per_interbranch/test_push.py' |
93 | --- bzrlib/tests/per_interbranch/test_push.py 2012-03-14 10:17:12 +0000 |
94 | +++ bzrlib/tests/per_interbranch/test_push.py 2012-08-04 14:30:26 +0000 |
95 | @@ -294,7 +294,7 @@ |
96 | |
97 | def setUp(self): |
98 | self.hook_calls = [] |
99 | - TestCaseWithInterBranch.setUp(self) |
100 | + super(TestPushHook, self).setUp() |
101 | |
102 | def capture_post_push_hook(self, result): |
103 | """Capture post push hook calls to self.hook_calls. |
104 | |
105 | === modified file 'bzrlib/tests/per_merger.py' |
106 | --- bzrlib/tests/per_merger.py 2011-12-05 14:21:55 +0000 |
107 | +++ bzrlib/tests/per_merger.py 2012-08-04 14:30:26 +0000 |
108 | @@ -209,7 +209,7 @@ |
109 | """Tests that the 'merge_file_content' hook is invoked.""" |
110 | |
111 | def setUp(self): |
112 | - TestCaseWithTransport.setUp(self) |
113 | + super(TestHookMergeFileContent, self).setUp() |
114 | self.hook_log = [] |
115 | |
116 | def install_hook_inactive(self): |
117 | |
118 | === modified file 'bzrlib/tests/per_tree/test_inv.py' |
119 | --- bzrlib/tests/per_tree/test_inv.py 2011-06-14 01:26:41 +0000 |
120 | +++ bzrlib/tests/per_tree/test_inv.py 2012-08-04 14:30:26 +0000 |
121 | @@ -42,7 +42,7 @@ |
122 | _test_needs_features = [features.SymlinkFeature] |
123 | |
124 | def setUp(self): |
125 | - per_tree.TestCaseWithTree.setUp(self) |
126 | + super(TestInventoryWithSymlinks, self).setUp() |
127 | self.tree = self.get_tree_with_subdirs_and_all_content_types() |
128 | self.tree.lock_read() |
129 | self.addCleanup(self.tree.unlock) |
130 | |
131 | === modified file 'bzrlib/tests/per_versionedfile.py' |
132 | --- bzrlib/tests/per_versionedfile.py 2011-08-19 22:34:02 +0000 |
133 | +++ bzrlib/tests/per_versionedfile.py 2012-08-04 14:30:26 +0000 |
134 | @@ -841,7 +841,7 @@ |
135 | class TestPlanMergeVersionedFile(TestCaseWithMemoryTransport): |
136 | |
137 | def setUp(self): |
138 | - TestCaseWithMemoryTransport.setUp(self) |
139 | + super(TestPlanMergeVersionedFile, self).setUp() |
140 | mapper = PrefixMapper() |
141 | factory = make_file_factory(True, mapper) |
142 | self.vf1 = factory(self.get_transport('root-1')) |
143 | @@ -2746,7 +2746,7 @@ |
144 | return ret |
145 | |
146 | def setUp(self): |
147 | - TestCase.setUp(self) |
148 | + super(VirtualVersionedFilesTests, self).setUp() |
149 | self._lines = {} |
150 | self._parent_map = {} |
151 | self.texts = VirtualVersionedFiles(self._get_parent_map, |
152 | |
153 | === modified file 'bzrlib/tests/per_workingtree/test_eol_conversion.py' |
154 | --- bzrlib/tests/per_workingtree/test_eol_conversion.py 2010-01-25 17:48:22 +0000 |
155 | +++ bzrlib/tests/per_workingtree/test_eol_conversion.py 2012-08-04 14:30:26 +0000 |
156 | @@ -51,7 +51,7 @@ |
157 | if not f(): |
158 | raise TestSkipped("format %s doesn't support content filtering" |
159 | % fmt) |
160 | - TestCaseWithWorkingTree.setUp(self) |
161 | + super(TestEolConversion, self).setUp() |
162 | |
163 | def patch_rules_searcher(self, eol): |
164 | """Patch in a custom rules searcher with a given eol setting.""" |
165 | |
166 | === modified file 'bzrlib/tests/per_workingtree/test_views.py' |
167 | --- bzrlib/tests/per_workingtree/test_views.py 2009-07-10 07:14:02 +0000 |
168 | +++ bzrlib/tests/per_workingtree/test_views.py 2012-08-04 14:30:26 +0000 |
169 | @@ -40,7 +40,7 @@ |
170 | "supports views, assuming not" % fmt) |
171 | if not f(): |
172 | raise TestSkipped("format %s doesn't support views" % fmt) |
173 | - TestCaseWithWorkingTree.setUp(self) |
174 | + super(TestTreeViews, self).setUp() |
175 | |
176 | def test_views_initially_empty(self): |
177 | wt = self.make_branch_and_tree('wt') |
178 | @@ -172,7 +172,7 @@ |
179 | raise TestSkipped("Format %s declares that views are supported" |
180 | % fmt) |
181 | # it's covered by TestTreeViews |
182 | - TestCaseWithWorkingTree.setUp(self) |
183 | + super(TestUnsupportedViews, self).setUp() |
184 | |
185 | def test_view_methods_raise(self): |
186 | wt = self.make_branch_and_tree('wt') |
187 | |
188 | === modified file 'bzrlib/tests/test_btree_index.py' |
189 | --- bzrlib/tests/test_btree_index.py 2012-02-27 15:49:07 +0000 |
190 | +++ bzrlib/tests/test_btree_index.py 2012-08-04 14:30:26 +0000 |
191 | @@ -59,7 +59,7 @@ |
192 | # that they test. |
193 | |
194 | def setUp(self): |
195 | - TestCaseWithTransport.setUp(self) |
196 | + super(BTreeTestCase, self).setUp() |
197 | self.overrideAttr(btree_index, '_RESERVED_HEADER_BYTES', 100) |
198 | |
199 | def make_nodes(self, count, key_elements, reference_lists): |
200 | @@ -1206,7 +1206,7 @@ |
201 | scenarios = btreeparser_scenarios() |
202 | |
203 | def setUp(self): |
204 | - BTreeTestCase.setUp(self) |
205 | + super(TestBTreeNodes, self).setUp() |
206 | self.overrideAttr(btree_index, '_btree_serializer', self.parse_btree) |
207 | |
208 | def test_LeafNode_1_0(self): |
209 | |
210 | === modified file 'bzrlib/tests/test_bugtracker.py' |
211 | --- bzrlib/tests/test_bugtracker.py 2010-09-25 20:08:01 +0000 |
212 | +++ bzrlib/tests/test_bugtracker.py 2012-08-04 14:30:26 +0000 |
213 | @@ -37,7 +37,7 @@ |
214 | return "http://bugs.com/%s" % bug_id |
215 | |
216 | def setUp(self): |
217 | - TestCaseWithMemoryTransport.setUp(self) |
218 | + super(TestGetBugURL, self).setUp() |
219 | self.tracker_type = TestGetBugURL.TransientTracker |
220 | self.tracker_type.log = [] |
221 | bugtracker.tracker_registry.register('transient', self.tracker_type) |
222 | @@ -185,7 +185,7 @@ |
223 | """Tests for URLParametrizedBugTracker.""" |
224 | |
225 | def setUp(self): |
226 | - TestCaseWithMemoryTransport.setUp(self) |
227 | + super(TestURLParametrizedBugTracker, self).setUp() |
228 | self.url = 'http://twistedmatrix.com/trac' |
229 | self.tracker = bugtracker.URLParametrizedBugTracker('some', 'ticket/') |
230 | |
231 | @@ -220,7 +220,7 @@ |
232 | """Tests for URLParametrizedIntegerBugTracker.""" |
233 | |
234 | def setUp(self): |
235 | - TestCaseWithMemoryTransport.setUp(self) |
236 | + super(TestURLParametrizedIntegerBugTracker, self).setUp() |
237 | self.url = 'http://twistedmatrix.com/trac' |
238 | self.tracker = bugtracker.URLParametrizedIntegerBugTracker('some', |
239 | 'ticket/') |
240 | |
241 | === modified file 'bzrlib/tests/test_commands.py' |
242 | --- bzrlib/tests/test_commands.py 2012-01-02 14:41:49 +0000 |
243 | +++ bzrlib/tests/test_commands.py 2012-08-04 14:30:26 +0000 |
244 | @@ -194,7 +194,7 @@ |
245 | class TestRegisterLazy(tests.TestCase): |
246 | |
247 | def setUp(self): |
248 | - tests.TestCase.setUp(self) |
249 | + super(TestRegisterLazy, self).setUp() |
250 | import bzrlib.tests.fake_command |
251 | del sys.modules['bzrlib.tests.fake_command'] |
252 | global lazy_command_imported |
253 | |
254 | === modified file 'bzrlib/tests/test_directory_service.py' |
255 | --- bzrlib/tests/test_directory_service.py 2012-03-21 13:29:11 +0000 |
256 | +++ bzrlib/tests/test_directory_service.py 2012-08-04 14:30:26 +0000 |
257 | @@ -42,7 +42,7 @@ |
258 | class TestDirectoryLookup(TestCase): |
259 | |
260 | def setUp(self): |
261 | - TestCase.setUp(self) |
262 | + super(TestDirectoryLookup, self).setUp() |
263 | self.registry = DirectoryServiceRegistry() |
264 | self.registry.register('foo:', FooService, 'Map foo URLs to http urls') |
265 | |
266 | |
267 | === modified file 'bzrlib/tests/test_dirstate.py' |
268 | --- bzrlib/tests/test_dirstate.py 2012-02-23 19:45:15 +0000 |
269 | +++ bzrlib/tests/test_dirstate.py 2012-08-04 14:30:26 +0000 |
270 | @@ -64,8 +64,7 @@ |
271 | _native_to_unicode = None # Not used yet |
272 | |
273 | def setUp(self): |
274 | - tests.TestCaseWithTransport.setUp(self) |
275 | - |
276 | + super(TestCaseWithDirState, self).setUp() |
277 | self.overrideAttr(osutils, |
278 | '_selected_dir_reader', self._dir_reader_class()) |
279 | |
280 | |
281 | === modified file 'bzrlib/tests/test_generate_docs.py' |
282 | --- bzrlib/tests/test_generate_docs.py 2011-01-12 01:01:53 +0000 |
283 | +++ bzrlib/tests/test_generate_docs.py 2012-08-04 14:30:26 +0000 |
284 | @@ -34,7 +34,7 @@ |
285 | class TestGenerateDocs(TestCase): |
286 | |
287 | def setUp(self): |
288 | - TestCase.setUp(self) |
289 | + super(TestGenerateDocs, self).setUp() |
290 | self.sio = StringIO() |
291 | self.options = Options() |
292 | self.options.bzr_name = 'bzr' |
293 | |
294 | === modified file 'bzrlib/tests/test_help.py' |
295 | --- bzrlib/tests/test_help.py 2011-09-27 13:18:53 +0000 |
296 | +++ bzrlib/tests/test_help.py 2012-08-04 14:30:26 +0000 |
297 | @@ -499,7 +499,7 @@ |
298 | class TestHelp(tests.TestCase): |
299 | |
300 | def setUp(self): |
301 | - tests.TestCase.setUp(self) |
302 | + super(TestHelp, self).setUp() |
303 | commands.install_bzr_command_hooks() |
304 | |
305 | |
306 | |
307 | === modified file 'bzrlib/tests/test_http.py' |
308 | --- bzrlib/tests/test_http.py 2012-02-23 23:41:51 +0000 |
309 | +++ bzrlib/tests/test_http.py 2012-08-04 14:30:26 +0000 |
310 | @@ -487,7 +487,7 @@ |
311 | ) |
312 | |
313 | def setUp(self): |
314 | - http_utils.TestCaseWithWebserver.setUp(self) |
315 | + super(TestHTTPConnections, self).setUp() |
316 | self.build_tree(['foo/', 'foo/bar'], line_endings='binary', |
317 | transport=self.get_transport()) |
318 | |
319 | @@ -1163,7 +1163,7 @@ |
320 | protocol_version=self._protocol_version) |
321 | |
322 | def setUp(self): |
323 | - http_utils.TestCaseWithWebserver.setUp(self) |
324 | + super(TestLimitedRangeRequestServer, self).setUp() |
325 | # We need to manipulate ranges that correspond to real chunks in the |
326 | # response, so we build a content appropriately. |
327 | filler = ''.join(['abcdefghij' for x in range(102)]) |
328 | @@ -1355,7 +1355,7 @@ |
329 | ) |
330 | |
331 | def setUp(self): |
332 | - http_utils.TestCaseWithWebserver.setUp(self) |
333 | + super(TestRanges, self).setUp() |
334 | self.build_tree_contents([('a', '0123456789')],) |
335 | |
336 | def create_transport_readonly_server(self): |
337 | @@ -2123,7 +2123,6 @@ |
338 | """ |
339 | |
340 | def setUp(self): |
341 | - tests.TestCase.setUp(self) |
342 | self.server = self._activity_server(self._protocol_version) |
343 | self.server.start_server() |
344 | self.addCleanup(self.server.stop_server) |
345 | @@ -2266,6 +2265,7 @@ |
346 | ) |
347 | |
348 | def setUp(self): |
349 | + super(TestActivity, self).setUp() |
350 | TestActivityMixin.setUp(self) |
351 | |
352 | |
353 | @@ -2280,6 +2280,7 @@ |
354 | _protocol_version = 'HTTP/1.1' |
355 | |
356 | def setUp(self): |
357 | + super(TestNoReportActivity, self).setUp() |
358 | self._transport =_urllib.HttpTransport_urllib |
359 | TestActivityMixin.setUp(self) |
360 | |
361 | |
362 | === modified file 'bzrlib/tests/test_http_response.py' |
363 | --- bzrlib/tests/test_http_response.py 2010-02-17 17:11:16 +0000 |
364 | +++ bzrlib/tests/test_http_response.py 2012-08-04 14:30:26 +0000 |
365 | @@ -800,7 +800,7 @@ |
366 | """ |
367 | |
368 | def setUp(self): |
369 | - tests.TestCase.setUp(self) |
370 | + super(TestRangeFileSizeReadLimited, self).setUp() |
371 | # create a test datablock larger than _max_read_size. |
372 | chunk_size = response.RangeFile._max_read_size |
373 | test_pattern = '0123456789ABCDEF' |
374 | |
375 | === modified file 'bzrlib/tests/test_ignores.py' |
376 | --- bzrlib/tests/test_ignores.py 2011-05-13 12:51:05 +0000 |
377 | +++ bzrlib/tests/test_ignores.py 2012-08-04 14:30:26 +0000 |
378 | @@ -149,7 +149,7 @@ |
379 | class TestRuntimeIgnores(TestCase): |
380 | |
381 | def setUp(self): |
382 | - TestCase.setUp(self) |
383 | + super(TestRuntimeIgnores, self).setUp() |
384 | |
385 | # For the purposes of these tests, we must have no |
386 | # runtime ignores |
387 | |
388 | === modified file 'bzrlib/tests/test_lazy_import.py' |
389 | --- bzrlib/tests/test_lazy_import.py 2012-01-05 09:50:04 +0000 |
390 | +++ bzrlib/tests/test_lazy_import.py 2012-08-04 14:30:26 +0000 |
391 | @@ -94,7 +94,7 @@ |
392 | """ |
393 | |
394 | def setUp(self): |
395 | - TestCase.setUp(self) |
396 | + super(TestScopeReplacer, self).setUp() |
397 | # These tests assume we will not be proxying, so make sure proxying is |
398 | # disabled. |
399 | orig_proxy = lazy_import.ScopeReplacer._should_proxy |
400 | @@ -456,7 +456,7 @@ |
401 | """Test the ability to have a lazily imported module or object""" |
402 | |
403 | def setUp(self): |
404 | - TestCaseInTempDir.setUp(self) |
405 | + super(ImportReplacerHelper, self).setUp() |
406 | self.create_modules() |
407 | base_path = self.test_dir + '/base' |
408 | |
409 | |
410 | === modified file 'bzrlib/tests/test_lockable_files.py' |
411 | --- bzrlib/tests/test_lockable_files.py 2011-08-19 22:34:02 +0000 |
412 | +++ bzrlib/tests/test_lockable_files.py 2012-08-04 14:30:26 +0000 |
413 | @@ -272,7 +272,7 @@ |
414 | _TestLockableFiles_mixin): |
415 | |
416 | def setUp(self): |
417 | - TestCaseInTempDir.setUp(self) |
418 | + super(TestLockableFiles_TransportLock, self).setUp() |
419 | t = transport.get_transport_from_path('.') |
420 | t.mkdir('.bzr') |
421 | self.sub_transport = t.clone('.bzr') |
422 | @@ -293,11 +293,11 @@ |
423 | |
424 | |
425 | class TestLockableFiles_LockDir(TestCaseInTempDir, |
426 | - _TestLockableFiles_mixin): |
427 | + _TestLockableFiles_mixin): |
428 | """LockableFile tests run with LockDir underneath""" |
429 | |
430 | def setUp(self): |
431 | - TestCaseInTempDir.setUp(self) |
432 | + super(TestLockableFiles_LockDir, self).setUp() |
433 | self.transport = transport.get_transport_from_path('.') |
434 | self.lockable = self.get_lockable() |
435 | # the lock creation here sets mode - test_permissions on branch |
436 | @@ -329,11 +329,11 @@ |
437 | |
438 | |
439 | class TestLockableFiles_RemoteLockDir(TestCaseWithSmartMedium, |
440 | - _TestLockableFiles_mixin): |
441 | + _TestLockableFiles_mixin): |
442 | """LockableFile tests run with RemoteLockDir on a branch.""" |
443 | |
444 | def setUp(self): |
445 | - TestCaseWithSmartMedium.setUp(self) |
446 | + super(TestLockableFiles_RemoteLockDir, self).setUp() |
447 | # can only get a RemoteLockDir with some RemoteObject... |
448 | # use a branch as thats what we want. These mixin tests test the end |
449 | # to end behaviour, so stubbing out the backend and simulating would |
450 | |
451 | === modified file 'bzrlib/tests/test_log.py' |
452 | --- bzrlib/tests/test_log.py 2012-01-25 21:13:15 +0000 |
453 | +++ bzrlib/tests/test_log.py 2012-08-04 14:30:26 +0000 |
454 | @@ -1309,7 +1309,7 @@ |
455 | class TestLogWithBugs(TestCaseForLogFormatter, TestLogMixin): |
456 | |
457 | def setUp(self): |
458 | - TestCaseForLogFormatter.setUp(self) |
459 | + super(TestLogWithBugs, self).setUp() |
460 | log.properties_handler_registry.register( |
461 | 'bugs_properties_handler', |
462 | log._bugs_properties_handler) |
463 | @@ -1389,7 +1389,7 @@ |
464 | class TestLogForAuthors(TestCaseForLogFormatter): |
465 | |
466 | def setUp(self): |
467 | - TestCaseForLogFormatter.setUp(self) |
468 | + super(TestLogForAuthors, self).setUp() |
469 | self.wt = self.make_standard_commit('nicky', |
470 | authors=['John Doe <jdoe@example.com>', |
471 | 'Jane Rey <jrey@example.com>']) |
472 | |
473 | === modified file 'bzrlib/tests/test_merge.py' |
474 | --- bzrlib/tests/test_merge.py 2012-01-28 12:47:17 +0000 |
475 | +++ bzrlib/tests/test_merge.py 2012-08-04 14:30:26 +0000 |
476 | @@ -559,7 +559,7 @@ |
477 | class TestPlanMerge(TestCaseWithMemoryTransport): |
478 | |
479 | def setUp(self): |
480 | - TestCaseWithMemoryTransport.setUp(self) |
481 | + super(TestPlanMerge, self).setUp() |
482 | mapper = versionedfile.PrefixMapper() |
483 | factory = knit.make_file_factory(True, mapper) |
484 | self.vf = factory(self.get_transport()) |
485 | |
486 | === modified file 'bzrlib/tests/test_osutils.py' |
487 | --- bzrlib/tests/test_osutils.py 2012-03-12 19:01:05 +0000 |
488 | +++ bzrlib/tests/test_osutils.py 2012-08-04 14:30:26 +0000 |
489 | @@ -554,7 +554,7 @@ |
490 | """Test pumpfile method.""" |
491 | |
492 | def setUp(self): |
493 | - tests.TestCase.setUp(self) |
494 | + super(TestPumpFile, self).setUp() |
495 | # create a test datablock |
496 | self.block_size = 512 |
497 | pattern = '0123456789ABCDEF' |
498 | @@ -1771,7 +1771,7 @@ |
499 | _native_to_unicode = None |
500 | |
501 | def setUp(self): |
502 | - tests.TestCaseInTempDir.setUp(self) |
503 | + super(TestDirReader, self).setUp() |
504 | self.overrideAttr(osutils, |
505 | '_selected_dir_reader', self._dir_reader_class()) |
506 | |
507 | @@ -1985,7 +1985,7 @@ |
508 | class TestTerminalWidth(tests.TestCase): |
509 | |
510 | def setUp(self): |
511 | - tests.TestCase.setUp(self) |
512 | + super(TestTerminalWidth, self).setUp() |
513 | self._orig_terminal_size_state = osutils._terminal_size_state |
514 | self._orig_first_terminal_size = osutils._first_terminal_size |
515 | self.addCleanup(self.restore_osutils_globals) |
516 | @@ -2072,7 +2072,7 @@ |
517 | _test_needs_features = [features.chown_feature] |
518 | |
519 | def setUp(self): |
520 | - tests.TestCaseInTempDir.setUp(self) |
521 | + super(TestCreationOps, self).setUp() |
522 | self.overrideAttr(os, 'chown', self._dummy_chown) |
523 | |
524 | # params set by call to _dummy_chown |
525 | |
526 | === modified file 'bzrlib/tests/test_osutils_encodings.py' |
527 | --- bzrlib/tests/test_osutils_encodings.py 2012-01-05 10:37:58 +0000 |
528 | +++ bzrlib/tests/test_osutils_encodings.py 2012-08-04 14:30:26 +0000 |
529 | @@ -72,7 +72,7 @@ |
530 | """Test the auto-detection of proper terminal encoding.""" |
531 | |
532 | def setUp(self): |
533 | - TestCase.setUp(self) |
534 | + super(TestTerminalEncoding, self).setUp() |
535 | self.overrideAttr(sys, 'stdin') |
536 | self.overrideAttr(sys, 'stdout') |
537 | self.overrideAttr(sys, 'stderr') |
538 | @@ -167,7 +167,7 @@ |
539 | """Test detection of default user encoding.""" |
540 | |
541 | def setUp(self): |
542 | - TestCase.setUp(self) |
543 | + super(TestUserEncoding, self).setUp() |
544 | self.overrideAttr(osutils, '_cached_user_encoding', None) |
545 | self.overrideAttr(locale, 'getpreferredencoding', self.get_encoding) |
546 | self.overrideAttr(locale, 'CODESET', None) |
547 | |
548 | === modified file 'bzrlib/tests/test_pack.py' |
549 | --- bzrlib/tests/test_pack.py 2011-11-29 09:13:54 +0000 |
550 | +++ bzrlib/tests/test_pack.py 2012-08-04 14:30:26 +0000 |
551 | @@ -73,7 +73,7 @@ |
552 | class TestContainerWriter(tests.TestCase): |
553 | |
554 | def setUp(self): |
555 | - tests.TestCase.setUp(self) |
556 | + super(TestContainerWriter, self).setUp() |
557 | self.output = StringIO() |
558 | self.writer = pack.ContainerWriter(self.output.write) |
559 | |
560 | |
561 | === modified file 'bzrlib/tests/test_remote.py' |
562 | --- bzrlib/tests/test_remote.py 2012-03-14 11:49:29 +0000 |
563 | +++ bzrlib/tests/test_remote.py 2012-08-04 14:30:26 +0000 |
564 | @@ -3270,7 +3270,7 @@ |
565 | """ |
566 | |
567 | def setUp(self): |
568 | - TestRemoteRepository.setUp(self) |
569 | + super(TestRepositoryInsertStream, self).setUp() |
570 | self.disable_verb('Repository.insert_stream_1.19') |
571 | |
572 | def test_unlocked_repo(self): |
573 | |
574 | === modified file 'bzrlib/tests/test_revisionspec.py' |
575 | --- bzrlib/tests/test_revisionspec.py 2011-12-01 23:10:02 +0000 |
576 | +++ bzrlib/tests/test_revisionspec.py 2012-08-04 14:30:26 +0000 |
577 | @@ -700,7 +700,7 @@ |
578 | class TestRevisionSpec_annotate(TestRevisionSpec): |
579 | |
580 | def setUp(self): |
581 | - TestRevisionSpec.setUp(self) |
582 | + super(TestRevisionSpec_annotate, self).setUp() |
583 | self.tree = self.make_branch_and_tree('annotate-tree') |
584 | self.build_tree_contents([('annotate-tree/file1', '1\n')]) |
585 | self.tree.add('file1') |
586 | |
587 | === modified file 'bzrlib/tests/test_selftest.py' |
588 | --- bzrlib/tests/test_selftest.py 2012-02-23 23:26:35 +0000 |
589 | +++ bzrlib/tests/test_selftest.py 2012-08-04 14:30:26 +0000 |
590 | @@ -1131,7 +1131,7 @@ |
591 | class SkippedTest(tests.TestCase): |
592 | |
593 | def setUp(self): |
594 | - tests.TestCase.setUp(self) |
595 | + super(SkippedTest, self).setUp() |
596 | calls.append('setUp') |
597 | self.addCleanup(self.cleanup) |
598 | |
599 | @@ -1630,7 +1630,7 @@ |
600 | class Test(tests.TestCase): |
601 | |
602 | def setUp(self): |
603 | - tests.TestCase.setUp(self) |
604 | + super(Test, self).setUp() |
605 | self.orig = self.overrideAttr(obj, 'test_attr') |
606 | |
607 | def test_value(self): |
608 | @@ -1649,7 +1649,7 @@ |
609 | class Test(tests.TestCase): |
610 | |
611 | def setUp(self): |
612 | - tests.TestCase.setUp(self) |
613 | + super(Test, self).setUp() |
614 | self.orig = self.overrideAttr(obj, 'test_attr', new='modified') |
615 | |
616 | def test_value(self): |
617 | @@ -2382,7 +2382,7 @@ |
618 | """Base class for tests testing how we might run bzr.""" |
619 | |
620 | def setUp(self): |
621 | - tests.TestCaseWithTransport.setUp(self) |
622 | + super(TestWithFakedStartBzrSubprocess, self).setUp() |
623 | self.subprocess_calls = [] |
624 | |
625 | def start_bzr_subprocess(self, process_args, env_changes=None, |
626 | @@ -2602,7 +2602,7 @@ |
627 | class TestSelftestFiltering(tests.TestCase): |
628 | |
629 | def setUp(self): |
630 | - tests.TestCase.setUp(self) |
631 | + super(TestSelftestFiltering, self).setUp() |
632 | self.suite = TestUtil.TestSuite() |
633 | self.loader = TestUtil.TestLoader() |
634 | self.suite.addTest(self.loader.loadTestsFromModule( |
635 | |
636 | === modified file 'bzrlib/tests/test_sftp_transport.py' |
637 | --- bzrlib/tests/test_sftp_transport.py 2012-02-23 23:26:35 +0000 |
638 | +++ bzrlib/tests/test_sftp_transport.py 2012-08-04 14:30:26 +0000 |
639 | @@ -147,8 +147,9 @@ |
640 | |
641 | |
642 | class SFTPNonServerTest(TestCase): |
643 | + |
644 | def setUp(self): |
645 | - TestCase.setUp(self) |
646 | + super(SFTPNonServerTest, self).setUp() |
647 | self.requireFeature(features.paramiko) |
648 | |
649 | def test_parse_url_with_home_dir(self): |
650 | @@ -361,7 +362,7 @@ |
651 | class TestSocketDelay(TestCase): |
652 | |
653 | def setUp(self): |
654 | - TestCase.setUp(self) |
655 | + super(TestSocketDelay, self).setUp() |
656 | self.requireFeature(features.paramiko) |
657 | |
658 | def test_delay(self): |
659 | |
660 | === modified file 'bzrlib/tests/test_smart.py' |
661 | --- bzrlib/tests/test_smart.py 2012-02-23 19:45:15 +0000 |
662 | +++ bzrlib/tests/test_smart.py 2012-08-04 14:30:26 +0000 |
663 | @@ -82,7 +82,7 @@ |
664 | |
665 | def setUp(self): |
666 | self.vfs_transport_factory = memory.MemoryServer |
667 | - tests.TestCaseWithTransport.setUp(self) |
668 | + super(TestCaseWithChrootedTransport, self).setUp() |
669 | self._chroot_server = None |
670 | |
671 | def get_transport(self, relpath=None): |
672 | @@ -1058,7 +1058,7 @@ |
673 | """Base test case for verbs that implement set_last_revision.""" |
674 | |
675 | def setUp(self): |
676 | - tests.TestCaseWithMemoryTransport.setUp(self) |
677 | + super(SetLastRevisionTestBase, self).setUp() |
678 | backing_transport = self.get_transport() |
679 | self.request = self.request_class(backing_transport) |
680 | self.tree = self.make_branch_and_memory_tree('.') |
681 | @@ -1373,9 +1373,6 @@ |
682 | |
683 | class TestSmartServerBranchRequestLockWrite(TestLockedBranch): |
684 | |
685 | - def setUp(self): |
686 | - tests.TestCaseWithMemoryTransport.setUp(self) |
687 | - |
688 | def test_lock_write_on_unlocked_branch(self): |
689 | backing = self.get_transport() |
690 | request = smart_branch.SmartServerBranchRequestLockWrite(backing) |
691 | @@ -1481,9 +1478,6 @@ |
692 | |
693 | class TestSmartServerBranchRequestGetPhysicalLockStatus(TestLockedBranch): |
694 | |
695 | - def setUp(self): |
696 | - tests.TestCaseWithMemoryTransport.setUp(self) |
697 | - |
698 | def test_true(self): |
699 | backing = self.get_transport() |
700 | request = smart_branch.SmartServerBranchRequestGetPhysicalLockStatus( |
701 | @@ -1509,9 +1503,6 @@ |
702 | |
703 | class TestSmartServerBranchRequestUnlock(TestLockedBranch): |
704 | |
705 | - def setUp(self): |
706 | - tests.TestCaseWithMemoryTransport.setUp(self) |
707 | - |
708 | def test_unlock_on_locked_branch_and_repo(self): |
709 | backing = self.get_transport() |
710 | request = smart_branch.SmartServerBranchRequestUnlock(backing) |
711 | @@ -2201,9 +2192,6 @@ |
712 | |
713 | class TestSmartServerRepositoryUnlock(tests.TestCaseWithMemoryTransport): |
714 | |
715 | - def setUp(self): |
716 | - tests.TestCaseWithMemoryTransport.setUp(self) |
717 | - |
718 | def test_unlock_on_locked_repo(self): |
719 | backing = self.get_transport() |
720 | request = smart_repo.SmartServerRepositoryUnlock(backing) |
721 | |
722 | === modified file 'bzrlib/tests/test_smart_transport.py' |
723 | --- bzrlib/tests/test_smart_transport.py 2012-02-23 23:41:51 +0000 |
724 | +++ bzrlib/tests/test_smart_transport.py 2012-08-04 14:30:26 +0000 |
725 | @@ -3388,7 +3388,7 @@ |
726 | """ |
727 | |
728 | def setUp(self): |
729 | - tests.TestCase.setUp(self) |
730 | + super(TestResponseEncoderBufferingProtocolThree, self).setUp() |
731 | self.writes = [] |
732 | self.responder = protocol.ProtocolThreeResponder(self.writes.append) |
733 | |
734 | |
735 | === modified file 'bzrlib/tests/test_symbol_versioning.py' |
736 | --- bzrlib/tests/test_symbol_versioning.py 2011-01-12 01:01:53 +0000 |
737 | +++ bzrlib/tests/test_symbol_versioning.py 2012-08-04 14:30:26 +0000 |
738 | @@ -222,7 +222,7 @@ |
739 | class TestSuppressAndActivate(TestCase): |
740 | |
741 | def setUp(self): |
742 | - TestCase.setUp(self) |
743 | + super(TestSuppressAndActivate, self).setUp() |
744 | existing_filters = list(warnings.filters) |
745 | def restore(): |
746 | warnings.filters[:] = existing_filters |
747 | |
748 | === modified file 'bzrlib/tests/test_wsgi.py' |
749 | --- bzrlib/tests/test_wsgi.py 2011-12-23 10:01:08 +0000 |
750 | +++ bzrlib/tests/test_wsgi.py 2012-08-04 14:30:26 +0000 |
751 | @@ -68,7 +68,7 @@ |
752 | class TestWSGI(tests.TestCaseInTempDir, WSGITestMixin): |
753 | |
754 | def setUp(self): |
755 | - tests.TestCase.setUp(self) |
756 | + super(TestWSGI, self).setUp() |
757 | self.status = None |
758 | self.headers = None |
759 | |
760 | |
761 | === modified file 'bzrlib/tests/test_xml.py' |
762 | --- bzrlib/tests/test_xml.py 2012-01-27 18:41:15 +0000 |
763 | +++ bzrlib/tests/test_xml.py 2012-08-04 14:30:26 +0000 |
764 | @@ -500,7 +500,7 @@ |
765 | """Whitebox testing of the _encode_and_escape function.""" |
766 | |
767 | def setUp(self): |
768 | - TestCase.setUp(self) |
769 | + super(TestEncodeAndEscape, self).setUp() |
770 | # Keep the cache clear before and after the test |
771 | bzrlib.xml_serializer._clear_cache() |
772 | self.addCleanup(bzrlib.xml_serializer._clear_cache) |
Ho ho ho, should grep to see if there are more of these.