Skip to content

fixes imports to be compatible with Python 2.7 and 3.3+ - #653

Closed
HelioGuilherme66 wants to merge 1 commit into
robotframework:masterfrom
HelioGuilherme66:fiximports
Closed

HelioGuilherme66 wants to merge 1 commit into
robotframework:masterfrom
HelioGuilherme66:fiximports

Conversation

@HelioGuilherme66

Copy link
Copy Markdown
Member

Relative imports processed with futurized:
RefactoringTool: Files that were modified:
RefactoringTool: .\src\Selenium2Library__init__.py
RefactoringTool: .\src\Selenium2Library\webdrivermonkeypatches.py
RefactoringTool: .\src\Selenium2Library\keywords__init__.py
RefactoringTool: .\src\Selenium2Library\keywords_alert.py
RefactoringTool: .\src\Selenium2Library\keywords_browsermanagement.py
RefactoringTool: .\src\Selenium2Library\keywords_cookie.py
RefactoringTool: .\src\Selenium2Library\keywords_element.py
RefactoringTool: .\src\Selenium2Library\keywords_formelement.py
RefactoringTool: .\src\Selenium2Library\keywords_javascript.py
RefactoringTool: .\src\Selenium2Library\keywords_logging.py
RefactoringTool: .\src\Selenium2Library\keywords_runonfailure.py
RefactoringTool: .\src\Selenium2Library\keywords_screenshot.py
RefactoringTool: .\src\Selenium2Library\keywords_selectelement.py
RefactoringTool: .\src\Selenium2Library\keywords_tableelement.py
RefactoringTool: .\src\Selenium2Library\keywords_waiting.py
RefactoringTool: .\src\Selenium2Library\locators__init__.py
RefactoringTool: .\src\Selenium2Library\locators\tableelementfinder.py
RefactoringTool: .\src\Selenium2Library\utils__init__.py
RefactoringTool: .\src\Selenium2Library\utils\librarylistener.py
RefactoringTool: .\src\Selenium2Library\utils\events__init__.py
RefactoringTool: .\src\Selenium2Library\utils\events\scope_event.py
RefactoringTool: .\test\lib\mockito__init__.py
RefactoringTool: .\test\lib\mockito\inorder.py
RefactoringTool: .\test\lib\mockito\invocation.py
RefactoringTool: .\test\lib\mockito\mocking.py
RefactoringTool: .\test\lib\mockito\mockito.py
RefactoringTool: .\test\lib\mockito\spying.py

Imports in single lines and on top of files.
PEP8 E401 and E402

RefactoringTool: Files that were modified:
RefactoringTool: .\src\Selenium2Library\__init__.py
RefactoringTool: .\src\Selenium2Library\webdrivermonkeypatches.py
RefactoringTool: .\src\Selenium2Library\keywords\__init__.py
RefactoringTool: .\src\Selenium2Library\keywords\_alert.py
RefactoringTool: .\src\Selenium2Library\keywords\_browsermanagement.py
RefactoringTool: .\src\Selenium2Library\keywords\_cookie.py
RefactoringTool: .\src\Selenium2Library\keywords\_element.py
RefactoringTool: .\src\Selenium2Library\keywords\_formelement.py
RefactoringTool: .\src\Selenium2Library\keywords\_javascript.py
RefactoringTool: .\src\Selenium2Library\keywords\_logging.py
RefactoringTool: .\src\Selenium2Library\keywords\_runonfailure.py
RefactoringTool: .\src\Selenium2Library\keywords\_screenshot.py
RefactoringTool: .\src\Selenium2Library\keywords\_selectelement.py
RefactoringTool: .\src\Selenium2Library\keywords\_tableelement.py
RefactoringTool: .\src\Selenium2Library\keywords\_waiting.py
RefactoringTool: .\src\Selenium2Library\locators\__init__.py
RefactoringTool: .\src\Selenium2Library\locators\tableelementfinder.py
RefactoringTool: .\src\Selenium2Library\utils\__init__.py
RefactoringTool: .\src\Selenium2Library\utils\librarylistener.py
RefactoringTool: .\src\Selenium2Library\utils\events\__init__.py
RefactoringTool: .\src\Selenium2Library\utils\events\scope_event.py
RefactoringTool: .\test\lib\mockito\__init__.py
RefactoringTool: .\test\lib\mockito\inorder.py
RefactoringTool: .\test\lib\mockito\invocation.py
RefactoringTool: .\test\lib\mockito\mocking.py
RefactoringTool: .\test\lib\mockito\mockito.py
RefactoringTool: .\test\lib\mockito\spying.py

Imports in single lines and on top of files.
PEP8 E401 and E402
@pekkaklarck

pekkaklarck commented Sep 6, 2016 •

Copy link
Copy Markdown
Member

Looks pretty good. Some things to be fixed:

  • _alert.py is totally rewritten. It seems it originally had CRLF line feeds and now they are all turned to LF. I guess you used a tool to fix imports and it didn't keep old line feeds. Changing line feeds to LF is good in general, but should rather be in a separate commit/PR. Now it's hard to see what has changed in that file.
  • I don't think we really need from __future__ import absolute_import. Absolute and relative imports work in Python 2 also without that. The only benefit it brings is that accidental old-style relative import (i.e. without . prefix) would be invalid in Python 2, but if we are going to run tests with Python 3 we see failures there anyway.
  • Imports should be grouped as recommended by pep-8.
  • Unused imports should be removed.

@pekkaklarck

Copy link
Copy Markdown
Member

Import cleanup, including Python 3 compatibility, was done by PR #705.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants