rtomac/robotframework-selenium2library — Issue #13: Internal unit tests are not python2.6 compatible
Author: emanlove
Created: 2011-12-04 19:28:49+00:00
State: open

If you run robotframework-selenium2library's internal unit tests using Python 2.6 several tests fail due to apparent difference in the assertRaises function between 2.6 and 2.7. Here is a sample test code.

```bash
$ hg clone https://code.google.com/p/robotframework/
$ git clone https://github.com/rtomac/robotframework-selenium2library.git

$ virtualenv -p /usr/bin/python2.6 --no-site-packages clean-python26-env
$ source ~/clean-python26-env/bin/activate
(clean-python26-env)$ cd robotframwork
(clean-python26-env)~/robotframwork $ python setup.py install
(clean-python26-env)~/robotframwork $ cd ~/robotframework-selenium2library
(clean-python26-env)~/robotframework-selenium2library $ python test/run_tests.py python *ff
# ... errors...
(clean-python26-env)~/robotframework-selenium2library $ deactivate
```

A sample error is

```
ERROR: test_select_with_null_browser (locators.test_windowmanager.WindowManagerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/emanlove/s2l-tests/test/unit/locators/test_windowmanager.py", line 19, in test_select_with_null_browser
with self.assertRaises(AssertionError):
TypeError: failUnlessRaises() takes at least 3 arguments (2 given)
```

Under Python 2.7 (sample test code below) there is no such issues with the unit tests

```
$ virtualenv -p /usr/bin/python2.7 --no-site-packages clean-python27-env
$ source ~/clean-python27-env/bin/activate
(clean-python27-env)$ cd robotframwork
(clean-python27-env)~/robotframwork $ python setup.py install
(clean-python27-env)~/robotframwork $ deactivate
(clean-python27-env)~/robotframwork $ cd ~/robotframework-selenium2library
(clean-python27-env)~/robotframework-selenium2library $ python test/run_tests.py python *ff
# ... no errors...
(clean-python27-env)~/robotframework-selenium2library $ deactivate
```