title: Why does the python-selenium-webdriver 'quit' not quit?
body: <p>I have a very complex <code>py.test</code> python-selenium test setup where I create a Firefox webdriver inside a <code>py.test</code> fixture. Here is some idea of what I am doing:</p>
  
  <p>'driver.py':</p>
  
  <pre><code>class Driver(object):
      """
      Driver class with basic wrappers around the selenium webdriver
      and other convenience methods.
      """
      def __init__(self, config, options):
          """Sets the driver and the config.
          """
  
          self.remote = options.getoption("--remote")
          self.headless = not options.getoption("--with-head")    
          if self.headless:
              self.display = Display(visible=0, size=(13660, 7680))
              self.display.start()
  
          # Start the selenium webdriver
          self.webdriver = fixefox_module.get_driver()
  </code></pre>
  
  <p>'conftest.py':</p>
  
  <pre><code>@pytest.fixture
  def basedriver(config, options):
  
      driver = driver.Driver(config, options)
  
      yield driver
  
      print("Debug 1")
      driver.webdriver.quit()
      print("Debug 2")
  </code></pre>
  
  <p>And when running the test I can only see <code>Debug 1</code> printed out. The whole process stops at this point and does not seem to proceed. The whole selenium test is stuck at the <code>webdriver.quit)</code>. </p>
  
  <p>The tests, however, completed successfully...</p>
  
  <p>What reasons could be for that behavior?</p>
  
  <p><strong>Addendum:</strong> </p>
  
  <p>The reason why the execution hangs seems to be a popup that asks the user if he wants to leave the page because of unsaved data. That means that the documentation for the <code>quit</code> method is incorrect. It states: </p>
  
  <pre><code>Quits the driver and close every associated window.
  </code></pre>