Repository navigation
Makes Selenium2Library compatible with both Python 3.4 and 2.7 - #556
HelioGuilherme66 wants to merge 3 commits into
Conversation
|
If the idea is to keep the code base Python 2 compatible, using 2to3 is not a good idea. Converting code manually and using In my opinion we should first decide together what approach to use when porting. That covers deciding what compatibility layer to use ( |
|
I did use |
7e4b8b0 to
c038689
Compare
|
I fixed the problem. There is a launcher for testserver depending if we are on Python 2 or 3. (forgot to add the files). Now the Travis failing should be related with timeout when starting server (locally runs fine). |
|
I totally disagree about 2to3. It has done lot of stupid changes to the code. I'm strongly -1 on using it. Much better do the conversion manually from the start than trying to fix mess 2to3 has created. Manually going through the code also makes it possible to enhance code otherwise. All that is going to help with future maintenance. |
|
Because many other projects have abandoned 2to3, for good reasons, I think we should not repeat their mistakes. Also I agree that code does not look good. I have not read Robot Because Python 3 is the future (on could even argue that it's a present), I think code must look like Python 3. |
|
A big problem with using |
|
I think we should update the #479, when we agree on something. Also setting up CI to test against Python 3 would be good too. And dropping 2.6 would be nice too, in my personal opinion. I think we should have some sort of consensus, how we are going to do this. |
|
Dropping Python 2.6 support is a good idea. It cost us way too many hours with RF 3.0. RF 3.1 will drop it. |
…d 3. Used the tool `futurize`from http://python-future.org/. The unit test "test_create_remote_browser_with_string_desired_prefs" in keywords/_browsermanagement.py was removed, because it became incompatible with Python 2.7. List of modified files: build_dist.py setup.py src/Selenium2Library/__init__.py src/Selenium2Library/keywords/__init__.py src/Selenium2Library/keywords/_alert.py src/Selenium2Library/keywords/_browsermanagement.py src/Selenium2Library/keywords/_cookie.py src/Selenium2Library/keywords/_element.py src/Selenium2Library/keywords/_formelement.py src/Selenium2Library/keywords/_javascript.py src/Selenium2Library/keywords/_logging.py src/Selenium2Library/keywords/_runonfailure.py src/Selenium2Library/keywords/_screenshot.py src/Selenium2Library/keywords/_selectelement.py src/Selenium2Library/keywords/_tableelement.py src/Selenium2Library/keywords/_waiting.py src/Selenium2Library/keywords/keywordgroup.py src/Selenium2Library/locators/__init__.py src/Selenium2Library/locators/customlocator.py src/Selenium2Library/locators/elementfinder.py src/Selenium2Library/locators/tableelementfinder.py src/Selenium2Library/locators/windowmanager.py src/Selenium2Library/utils/__init__.py src/Selenium2Library/utils/events/__init__.py src/Selenium2Library/utils/events/event.py src/Selenium2Library/utils/events/scope_event.py src/Selenium2Library/utils/librarylistener.py src/Selenium2Library/webdrivermonkeypatches.py src/ez_setup.py test/lib/mockito/__init__.py test/lib/mockito/inorder.py test/lib/mockito/invocation.py test/lib/mockito/matchers.py test/lib/mockito/mock_registry.py test/lib/mockito/mocking.py test/lib/mockito/mockito.py test/lib/mockito/spying.py test/lib/mockito/verification.py test/resources/statuschecker.py test/resources/testserver/testserver.py test/run_tests.py test/run_unit_tests.py test/unit/keywords/test_browsermanagement.py test/unit/utils/test_browsercache.py
9c3551a to
d8a9b72
Compare
4942ab1 to
943de94
Compare
Added script for dependencies according to Python version. For Python 2.7 installs current robotframework. (If there is a better solution, please improve this one).
0dd7c5b to
ffbe4d0
Compare
|
Closing in favor of #564 (better commits/PR changes). |
Tested in Linux x64.