

def setUp(self):
    self.registry = CollectorRegistry()
    self.data = ''

    class TCPHandler(SocketServer.BaseRequestHandler):

        def handle(s):
            self.data = s.request.recv(1024)
    server = SocketServer.TCPServer(('', 0), TCPHandler)

    class ServingThread(threading.Thread):

        def run(self):
            server.handle_request()
            server.socket.close()
    server.t = ServingThread()
    self.t.start()
    address = ('localhost', server.server_address[1])
    self.gb = GraphiteBridge(address, self.registry, _time=FakeTime())

dataset/ETHPy150Open prometheus/client_python/tests/test_graphite_bridge.py TestGraphiteBridge.setUp/VarMisuse@110/127 `self`->`server`