Rev 5279: Merge sftp-leaks into catch-them-all in file:///home/vila/src/bzr/experimental/leaking-tests/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Jun 23 17:05:25 BST 2010
At file:///home/vila/src/bzr/experimental/leaking-tests/
------------------------------------------------------------
revno: 5279 [merge]
revision-id: v.ladeuil+lp at free.fr-20100623160524-lr122n65d45igiec
parent: v.ladeuil+lp at free.fr-20100623142539-t0l4glus9221knh7
parent: v.ladeuil+lp at free.fr-20100623160514-xn5oou13htc4p7uu
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: catch-them-all
timestamp: Wed 2010-06-23 18:05:24 +0200
message:
Merge sftp-leaks into catch-them-all
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/test_test_server.py test_test_server.py-20100601152414-r8rln0ok7514pcoz-1
bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2010-06-23 08:20:55 +0000
+++ b/NEWS 2010-06-23 16:02:59 +0000
@@ -183,18 +183,16 @@
Testing
*******
-<<<<<<< TREE
* Add ``bzrlib.tests.fixtures`` to hold code for setting up objects
to test. (Martin Pool)
-* ``test_import_tariff`` now respects BZR_PLUGINS_AT and BZR_PLUGINS_DISABLE.
- (Vincent Ladeuil, #595587)
-=======
* HTTP test servers would not leak threads (and sockets) anymore. They
won't hang on AIX anymore either.
(Vincent Ladeuil, #405745)
->>>>>>> MERGE-SOURCE
+* ``test_import_tariff`` now respects BZR_PLUGINS_AT and BZR_PLUGINS_DISABLE.
+ (Vincent Ladeuil, #595587)
+
bzr 2.2b3
#########
=== modified file 'bzrlib/tests/test_test_server.py'
--- a/bzrlib/tests/test_test_server.py 2010-06-07 17:07:05 +0000
+++ b/bzrlib/tests/test_test_server.py 2010-06-23 16:02:59 +0000
@@ -38,6 +38,46 @@
return suite
+class TestThreadWithException(tests.TestCase):
+
+ def test_start_and_join_smoke_test(self):
+ def do_nothing():
+ pass
+
+ tt = test_server.ThreadWithException(target=do_nothing)
+ tt.start()
+ tt.join()
+
+ def test_exception_is_re_raised(self):
+ class MyException(Exception):
+ pass
+
+ def raise_my_exception():
+ raise MyException()
+
+ tt = test_server.ThreadWithException(target=raise_my_exception)
+ tt.start()
+ self.assertRaises(MyException, tt.join)
+
+ def test_join_when_no_exception(self):
+ resume = threading.Event()
+ class MyException(Exception):
+ pass
+
+ def raise_my_exception():
+ # Wait for the test to tell us to resume
+ resume.wait()
+ # Now we can raise
+ raise MyException()
+
+ tt = test_server.ThreadWithException(target=raise_my_exception)
+ tt.start()
+ tt.join(timeout=0)
+ self.assertIs(None, tt.exception)
+ resume.set()
+ self.assertRaises(MyException, tt.join)
+
+
class TCPClient(object):
def __init__(self):
=== modified file 'bzrlib/tests/test_transport.py'
--- a/bzrlib/tests/test_transport.py 2010-06-23 14:25:17 +0000
+++ b/bzrlib/tests/test_transport.py 2010-06-23 16:05:14 +0000
@@ -993,43 +993,3 @@
# And the rest are threads
for t in started[1:]:
t.join()
-
-
-class TestThreadWithException(tests.TestCase):
-
- def test_start_and_join_smoke_test(self):
- def do_nothing():
- pass
-
- tt = test_server.ThreadWithException(target=do_nothing)
- tt.start()
- tt.join()
-
- def test_exception_is_re_raised(self):
- class MyException(Exception):
- pass
-
- def raise_my_exception():
- raise MyException()
-
- tt = test_server.ThreadWithException(target=raise_my_exception)
- tt.start()
- self.assertRaises(MyException, tt.join)
-
- def test_join_when_no_exception(self):
- resume = threading.Event()
- class MyException(Exception):
- pass
-
- def raise_my_exception():
- # Wait for the test to tell us to resume
- resume.wait()
- # Now we can raise
- raise MyException()
-
- tt = test_server.ThreadWithException(target=raise_my_exception)
- tt.start()
- tt.join(timeout=0)
- self.assertIs(None, tt.exception)
- resume.set()
- self.assertRaises(MyException, tt.join)
More information about the bazaar-commits
mailing list