New issue 268: Can't use Selenium with Tox
https://bitbucket.org/hpk42/tox/issues/268/cant-use-selenium-with-tox

vr2262:

Steps to reproduce:

1. Install `selenium` in a new virtual environment.
2. Create the file `test_selenium.py` with the contents:

        #!python

        import unittest

        from selenium import webdriver


        class TestBroken(unittest.TestCase):
            def setUp(self):
                self.driver = webdriver.Firefox()

            def tearDown(self):
                self.driver.quit()

            def test_broken(self):
                pass


3. Execute `$ python -m unittest`:

        .
        ----------------------------------------------------------------------
        Ran 1 test in 1.103s

        OK

4. Install `tox`.
5. Create the file `tox.ini` with the contents:

        [tox]
        skipsdist=True

        [testenv]
        deps=selenium
        commands=python -m unittest

6. Execute `$ tox`:

        python installed: selenium==2.47.1,wheel==0.24.0
        python runtests: PYTHONHASHSEED='275551244'
        python runtests: commands[0] | python -m unittest
        E/usr/lib64/python3.4/unittest/case.py:605: ResourceWarning: unclosed 
file <_io.BufferedWriter name='/dev/null'>
          outcome.errors.clear()

        ======================================================================
        ERROR: test_selenium (test_selenium.TestSelenium)
        ----------------------------------------------------------------------
        Traceback (most recent call last):
          File "/.../test_selenium.py", line 8, in setUp
            self.driver = webdriver.Firefox()
          File 
"/.../.tox/python/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py",
 line 77, in __init__
            self.binary, timeout),
          File 
"/.../.tox/python/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py",
 line 49, in __init__
            self.binary.launch_browser(self.profile)
          File 
"/.../.tox/python/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py",
 line 68, in launch_browser
            self._wait_until_connectable()
          File 
"/.../.tox/python/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py",
 line 98, in _wait_until_connectable
            raise WebDriverException("The browser appears to have exited "
        selenium.common.exceptions.WebDriverException: Message: The browser 
appears to have exited before we could connect. If you specified a log_file in 
the FirefoxBinary constructor, check it for details.


        ----------------------------------------------------------------------
        Ran 1 test in 1.060s

        FAILED (errors=1)
        ERROR: InvocationError: '/.../.tox/python/bin/python -m unittest'
        _________________________________________________________________ 
summary __________________________________________________________________
        ERROR:   python: commands failed



_______________________________________________
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit

Reply via email to