Skip to content

Commit

Permalink
Remove remaining traces of Python 2.6 support
Browse files Browse the repository at this point in the history
See #2276 for more details.
  • Loading branch information
hugovk authored and pekkaklarck committed Jun 8, 2018
1 parent 7f017b7 commit 787bec6
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 64 deletions.
7 changes: 0 additions & 7 deletions atest/interpreter.py
Expand Up @@ -45,11 +45,6 @@ def _get_name_and_version(self):

@property
def excludes(self):
if self.is_python and self.version == '2.6':
yield 'no-python26'
yield 'require-et13'
else:
yield 'require-python26'
if self.is_jython:
yield 'no-jython'
yield 'require-lxml'
Expand All @@ -75,8 +70,6 @@ def _platform_excludes(self):
yield 'no-windows'
if self.is_jython:
yield 'no-windows-jython'
if self.is_python and self.version == '2.6':
yield 'no-windows-python26'
if not self.is_windows:
yield 'require-windows'
if self.is_osx:
Expand Down
Expand Up @@ -20,7 +20,6 @@ Should Be Equal fails without values
Check test case ${TESTNAME}

Should Be Equal with multiline text uses diff
[Tags] no-python26 # diff contains extra spaces on python 2.6
Check test case ${TESTNAME}

Should Be Equal with multiline diff text requires both multiline
Expand Down
Expand Up @@ -39,7 +39,6 @@ Should Be Equal As Strings case-insensitive
Check test case ${TESTNAME}

Should Be Equal As Strings multiline
[Tags] no-python26 # diff contains extra spaces on python 2.6
Check test case ${TESTNAME}

Should Not Be Equal As Strings
Expand Down
Expand Up @@ -14,23 +14,23 @@ Kill process
Check Log Message ${tc.kws[1].msgs[1]} Process completed.

Terminate process running on shell
[Tags] no-windows-python26 no-jython
[Tags] no-jython
Check Test Case ${TESTNAME}

Kill process running on shell
[Tags] no-windows no-jython
Check Test Case ${TESTNAME}

Also child processes are terminated
[Tags] no-windows-python26 no-jython
[Tags] no-jython
Check Test Case ${TESTNAME}

Also child processes are killed
[Tags] no-windows no-jython
Check Test Case ${TESTNAME}

Kill process when terminate fails
[Tags] no-windows-python26 no-windows-jython
[Tags] no-windows-jython
${tc} = Check Test Case ${TESTNAME}
Check Log Message ${tc.kws[5].msgs[0]} Gracefully terminating process.
Check Log Message ${tc.kws[5].msgs[1]} Graceful termination failed.
Expand Down
10 changes: 0 additions & 10 deletions atest/robot/standard_libraries/xml/xpath.robot
Expand Up @@ -53,17 +53,7 @@ Non-ASCII tag names
Check Test Case ${TESTNAME}

More complex non-ASCII xpath
[Tags] no-python26
Check Test Case ${TESTNAME}

Warning when using more complex non-ASCII xpath with interpreter < 2.7
[Tags] require-python26
${tc}= Get Test Case More complex non-ASCII xpath
${msg}= Catenate
... XPATHs containing non-ASCII characters and other than tag names
... do not always work with Python versions prior to 2.7.
... Verify results manually and consider upgrading to 2.7.
Check Log Message ${tc.kws[0].kws[0].msgs[0]} ${msg} WARN

Evaluate xpath does not work
Check Test Case ${TESTNAME}
2 changes: 1 addition & 1 deletion atest/run.py
Expand Up @@ -12,7 +12,7 @@
The specified interpreter is used by acceptance tests under `atest/robot` to
run test cases under `atest/testdata`. It can be the name of the interpreter
like (e.g. `python` or `jython`, a path to the selected interpreter like
`/usr/bin/python26`, or a path to the standalone jar distribution (e.g.
`/usr/bin/python36`, or a path to the standalone jar distribution (e.g.
`dist/robotframework-2.9dev234.jar`). If the interpreter itself needs
arguments, the interpreter and arguments need to be quoted like `"py -3"`.
Expand Down
@@ -1,7 +1,5 @@
import os

from robot.utils import OrderedDict

from collections import OrderedDict

if os.name == 'java':
from java.lang import String
Expand Down
Expand Up @@ -118,7 +118,7 @@ Dictionaries Should Be Equal
Dictionaries Should Be Equal ${BIG} ${BIG}

Dictionaries Of Different Type Should Be Equal
${big2}= Evaluate robot.utils.OrderedDict($BIG) modules=robot
${big2}= Evaluate collections.OrderedDict($BIG) modules=collections
Dictionaries Should Be Equal ${BIG} ${big2}

Dictionaries Should Equal With First Dictionary Missing Keys
Expand Down Expand Up @@ -212,7 +212,7 @@ Log Dictionary With Different Log Levels
Log Dictionary With Different Dictionaries
Log Dictionary ${D0}
Log Dictionary ${D1}
${dict} = Evaluate robot.utils.OrderedDict(((True, 'xxx'), ('foo', []), ((1, 2, 3), 3.14))) modules=robot
${dict} = Evaluate collections.OrderedDict(((True, 'xxx'), ('foo', []), ((1, 2, 3), 3.14))) modules=collections
Log Dictionary ${dict}

Pop From Dictionary Without Default
Expand Down
2 changes: 1 addition & 1 deletion atest/testdata/variables/list_and_dict_variable_file.py
@@ -1,4 +1,4 @@
from robot.utils import OrderedDict
from collections import OrderedDict


def get_variables(*args):
Expand Down
2 changes: 1 addition & 1 deletion atest/testdata/variables/return_values.robot
Expand Up @@ -92,7 +92,7 @@ List Variable From Dictionary
Should Be Equal @{list} name
Should Be True ${list} == ['name']
@{list} = Create Dictionary a=1 b=2 c=3
Should Be True set(${list}) == set(['a', 'b', 'c'])
Should Be True set(${list}) == {'a', 'b', 'c'}

Unrepresentable objects to list variables
@{unrepr} = Return Unrepresentable Objects identifier=list
Expand Down
16 changes: 0 additions & 16 deletions src/robot/libraries/Remote.py
Expand Up @@ -262,22 +262,6 @@ def make_connection(self, host):
return self._connection[1]


if sys.version_info[:2] == (2, 6):

class TimeoutTransport(TimeoutTransport):

def make_connection(self, host):
host, extra_headers, x509 = self.get_host_info(host)
return TimeoutHTTP(host, timeout=self.timeout)

class TimeoutHTTP(httplib.HTTP):

def __init__(self, host='', port=None, strict=None, timeout=None):
if port == 0:
port = None
self._setup(self._connection_class(host, port, strict, timeout=timeout))


if IRONPYTHON:

class TimeoutTransport(xmlrpclib.Transport):
Expand Down
4 changes: 2 additions & 2 deletions src/robot/reporting/jsexecutionresult.py
Expand Up @@ -15,12 +15,12 @@

import sys
import time
from collections import OrderedDict

from robot.utils import OrderedDict, IRONPYTHON
from robot.utils import IRONPYTHON

from .stringcache import StringIndex


# http://ironpython.codeplex.com/workitem/31549
if IRONPYTHON and sys.version_info < (2, 7, 2):
int = long
Expand Down
4 changes: 3 additions & 1 deletion src/robot/reporting/stringcache.py
Expand Up @@ -13,7 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from robot.utils import OrderedDict, compress_text
from collections import OrderedDict

from robot.utils import compress_text


class StringIndex(int):
Expand Down
14 changes: 7 additions & 7 deletions src/robot/running/namespace.py
Expand Up @@ -13,22 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import copy
import os
from collections import OrderedDict
from itertools import chain

from robot.errors import DataError, KeywordError
from robot.libraries import STDLIBS
from robot.output import LOGGER, Message
from robot.parsing.settings import Library, Variables, Resource
from robot.utils import (eq, find_file, is_string, OrderedDict, printable_name,
seq2str2, RecommendationFinder)
from robot.parsing.settings import Library, Resource, Variables
from robot.utils import (RecommendationFinder, eq, find_file, is_string,
printable_name, seq2str2)

from .importer import ImportCache, Importer
from .runkwregister import RUN_KW_REGISTER
from .usererrorhandler import UserErrorHandler
from .userkeyword import UserLibrary
from .importer import Importer, ImportCache
from .runkwregister import RUN_KW_REGISTER


IMPORTER = Importer()

Expand Down
2 changes: 1 addition & 1 deletion src/robot/utils/__init__.py
Expand Up @@ -38,7 +38,7 @@
from .compat import isatty, py2to3, StringIO, with_metaclass
from .compress import compress_text
from .connectioncache import ConnectionCache
from .dotdict import DotDict, OrderedDict
from .dotdict import DotDict
from .encoding import (console_decode, console_encode,
system_decode, system_encode, CONSOLE_ENCODING,
SYSTEM_ENCODING)
Expand Down
8 changes: 2 additions & 6 deletions utest/utils/test_compat.py
Expand Up @@ -22,12 +22,8 @@ def test_with_io(self):
def test_with_detached_io_buffer(self):
with io.StringIO() as stream:
wrapper = io.TextIOWrapper(stream, 'UTF-8')
if sys.version_info >= (2, 7):
wrapper.detach()
exc_type = ValueError if PYTHON else AttributeError
else:
wrapper.buffer = None
exc_type = AttributeError
wrapper.detach()
exc_type = ValueError if PYTHON else AttributeError
assert_raises(exc_type, wrapper.isatty)
assert_false(isatty(wrapper))

Expand Down
3 changes: 2 additions & 1 deletion utest/utils/test_dotdict.py
@@ -1,8 +1,9 @@
import unittest
from collections import OrderedDict

from robot.utils import IRONPYTHON, DotDict
from robot.utils.asserts import (assert_equal, assert_false, assert_not_equal,
assert_raises, assert_true)
from robot.utils import DotDict, OrderedDict, IRONPYTHON


class TestDotDict(unittest.TestCase):
Expand Down

0 comments on commit 787bec6

Please sign in to comment.