docs: def configure(self, options, conf):
          """Parse the command line options and start an instance of mongodb
          """
          # This option has to be specified on the command line, to enable the
          # plugin.
          if not options.mongoengine or options.mongodb_bin:
              return
  
          if not options.mongodb_bin:
              self.mongodb_param['mongodb_bin'] = scan_path()
              if self.mongodb_param['mongodb_bin'] is None:
                  raise AssertionError(
                      "Mongoengine plugin enabled, but no mongod on path, "
                      "please specify path to binary\n"
                      "ie. --mongoengine-mongodb=/path/to/mongod")
          else:
              self.mongodb_param['mongodb_bin'] = os.path.abspath(
                  os.path.expanduser(os.path.expandvars(options.mongodb_bin)))
              if not os.path.exists(self.mongodb_param['mongodb_bin']):
                  raise AssertionError(
                      "Invalid mongodb binary %r" % \
                      self.mongodb_param['mongodb_bin'])
  
          # Its necessary to enable in nose
          self.enabled = True
  
          db_log_path = os.path.expandvars(os.path.expanduser(
              options.mongodb_logpath))
          try:
              db_file = open(db_log_path, "w")
              db_file.close()
          except Exception as exc:
              raise AssertionError("Invalid log path %r" % exc)
  
          if not options.mongodb_port:
              self.mongodb_param['db_port'] = get_open_port()
          else:
              self.mongodb_param['db_port'] = options.mongodb_port
  
          db_prealloc = options.mongodb_prealloc
          db_scripting = options.mongodb_scripting
  
          self.clear_context['module'] = options.mongoengine_clear_after_module
          self.clear_context['class'] = options.mongoengine_clear_after_class
  
          # generate random database name
          self.database_name = str(uuid.uuid1())
  
          #########################################
          # Start a instance of mongo
          #########################################
  
          # Stores data here
          self.mongodb_param['db_path'] = tempfile.mkdtemp()
          if not os.path.exists(self.mongodb_param['db_path']):
              os.mkdir(self.mongodb_param['db_path'])
  
          args = [
              self.mongodb_param['mongodb_bin'],
              "--dbpath",
              self.mongodb_param['db_path'],
              "--port",
              str(self.mongodb_param['db_port']),
              # don't flood stdout, we're not reading it
              "--quiet",
              # save the port
              "--nohttpinterface",
              # disable unused.
              "--nounixsocket",
              # use a smaller default file size
              "--smallfiles",
              # journaling on by default in 2.0 and makes it to slow
              # for tests, can causes failures in jenkins
              "--nojournal",
              # Default is /dev/null
              "--logpath",
              db_log_path,
              "-vvvvv"
              ]
  
          if not db_prealloc:
              args.append("--noprealloc")
  
          if not db_scripting:
              args.append("--noscripting")
  
          self.process = Popen(
              args,
              stdout=subprocess.PIPE,
              stderr=subprocess.STDOUT
              )
  
          self._running = True
          os.environ["TEST_MONGODB"] = "localhost:%s" % \
                                       self.mongodb_param['db_port']
          os.environ["TEST_MONGODB_DATABASE"] = self.database_name
  
          # Give a moment for mongodb to finish coming up
          time.sleep(0.3)
  
          # Connecting using mongoengine
          self.connection = connect(self.database_name, host="localhost",
                  port=self.mongodb_param['db_port'])