class_docstr: Mixin for making green versions of test classes
class_docstr_tok: ["Mixin","for","making","green","versions","of","test","classes"]
code: def tearDown(self):
      contexts = set([self.context])
      while self.sockets:
          sock = self.sockets.pop()
          contexts.add(
              sock.context
          )  # in case additional contexts are created
          sock.close()
      try:
          gevent.joinall(
              [gevent.spawn(ctx.term) for ctx in contexts],
              timeout=self.teardown_timeout,
              raise_error=True,
          )
      except gevent.Timeout:
          raise RuntimeError(
              "context could not terminate, open sockets likely remain in test"
          )
  
imports: import sys
  import time
  from threading import Thread
  from unittest import TestCase
  from pytest import mark
  import zmq
  from zmq.utils import jsonapi
label_desc: Use image node_id 2 for calling the GreenTest obj's underlying member method code with example usage: obj.tearDown() without return types