Nicer cleanup.

This commit is contained in:
Itamar Turner-Trauring 2022-02-03 12:44:55 -05:00
parent 1dfc0bde36
commit 23c8bde9d5

View File

@ -1113,6 +1113,7 @@ class _HTTPMixin(_SharedMixin):
self._listening_port = yield endpoint.listen(
Site(self._http_storage_server.get_resource())
)
self.addCleanup(self._listening_port.stopListening)
returnValue(
_HTTPStorageServer.from_http_client(
StorageClient(
@ -1124,11 +1125,6 @@ class _HTTPMixin(_SharedMixin):
# Eventually should also:
# self.assertTrue(IStorageServer.providedBy(client))
@inlineCallbacks
def tearDown(self):
yield _SharedMixin.tearDown(self)
yield self._listening_port.stopListening()
class FoolscapSharedAPIsTests(
_FoolscapMixin, IStorageServerSharedAPIsTestsMixin, AsyncTestCase