~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/https_server.py

  • Committer: Martin Pool
  • Date: 2010-09-14 09:47:23 UTC
  • mto: (5452.4.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 5476.
  • Revision ID: mbp@sourcefrog.net-20100914094723-2dn6e9q5ktpa1m8r
Update existing script tests to not ignore their output

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2011 Canonical Ltd
 
1
# Copyright (C) 2007-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
17
17
"""HTTPS test server, available when ssl python module is available"""
18
18
 
19
19
import ssl
20
 
import sys
21
20
 
22
21
from bzrlib.tests import (
23
22
    http_server,
52
51
            request.do_handshake()
53
52
        return serving
54
53
 
55
 
    def ignored_exceptions_during_shutdown(self, e):
56
 
        if (sys.version < (2, 7) and isinstance(e, TypeError)
57
 
            and e.args[0] == "'member_descriptor' object is not callable"):
58
 
            # Fixed in python-2.7 (and some Ubuntu 2.6) there is a bug where
59
 
            # the ssl socket fail to raise a socket.error when trying to read
60
 
            # from a closed socket. This is rarely observed in practice but
61
 
            # still make valid selftest runs fail if not caught.
62
 
            return True
63
 
        base = test_server.TestingTCPServerMixin
64
 
        return base.ignored_exceptions_during_shutdown(self, e)
65
 
 
66
54
 
67
55
class TestingHTTPSServer(TestingHTTPSServerMixin,
68
56
                         http_server.TestingHTTPServer):