y.
+ Python2 had looser comparison allowing cmp None and non Numerical types and collections.
+ Try to match the old behavior
"""
- return (x > y) - (x < y)
+ if isinstance(x, set) and isinstance(y, set):
+ raise TypeError('cannot compare sets using cmp()',)
+ try:
+ if isinstance(x, numbers.Number) and math.isnan(x):
+ if not isinstance(y, numbers.Number):
+ raise TypeError('cannot compare float("nan"), {type_y} with cmp'.format(type_y=type(y)))
+ if isinstance(y, int):
+ return 1
+ else:
+ return -1
+ if isinstance(y, numbers.Number) and math.isnan(y):
+ if not isinstance(x, numbers.Number):
+ raise TypeError('cannot compare {type_x}, float("nan") with cmp'.format(type_x=type(x)))
+ if isinstance(x, int):
+ return -1
+ else:
+ return 1
+ return (x > y) - (x < y)
+ except TypeError:
+ if x == y:
+ return 0
+ type_order = [
+ type(None),
+ numbers.Number,
+ dict, list,
+ set,
+ (str, bytes),
+ ]
+ x_type_index = y_type_index = None
+ for i, type_match in enumerate(type_order):
+ if isinstance(x, type_match):
+ x_type_index = i
+ if isinstance(y, type_match):
+ y_type_index = i
+ if cmp(x_type_index, y_type_index) == 0:
+ if isinstance(x, bytes) and isinstance(y, str):
+ return cmp(x.decode('ascii'), y)
+ if isinstance(y, bytes) and isinstance(x, str):
+ return cmp(x, y.decode('ascii'))
+ elif isinstance(x, list):
+ # if both arguments are lists take the comparison of the first non equal value
+ for x_elem, y_elem in zip(x, y):
+ elem_cmp_val = cmp(x_elem, y_elem)
+ if elem_cmp_val != 0:
+ return elem_cmp_val
+ # if all elements are equal, return equal/0
+ return 0
+ elif isinstance(x, dict):
+ if len(x) != len(y):
+ return cmp(len(x), len(y))
+ else:
+ x_key = min(a for a in x if a not in y or x[a] != y[a])
+ y_key = min(b for b in y if b not in x or x[b] != y[b])
+ if x_key != y_key:
+ return cmp(x_key, y_key)
+ else:
+ return cmp(x[x_key], y[y_key])
+ return cmp(x_type_index, y_type_index)
from sys import intern
@@ -42,7 +103,13 @@ def oct(number):
return '0' + builtins.oct(number)[2:]
raw_input = input
- from imp import reload
+
+ try:
+ from importlib import reload
+ except ImportError:
+ # for python2, python3 <= 3.4
+ from imp import reload
+
unicode = str
unichr = chr
xrange = range
@@ -82,7 +149,7 @@ def execfile(filename, myglobals=None, mylocals=None):
if not isinstance(mylocals, Mapping):
raise TypeError('locals must be a mapping')
with open(filename, "rb") as fin:
- source = fin.read()
+ source = fin.read()
code = compile(source, filename, "exec")
exec_(code, myglobals, mylocals)
diff --git a/src/past/types/basestring.py b/src/past/types/basestring.py
index 1cab22f6..9c21715a 100644
--- a/src/past/types/basestring.py
+++ b/src/past/types/basestring.py
@@ -25,9 +25,8 @@ class BaseBaseString(type):
def __instancecheck__(cls, instance):
return isinstance(instance, (bytes, str))
- def __subclasshook__(cls, thing):
- # TODO: What should go here?
- raise NotImplemented
+ def __subclasscheck__(cls, subclass):
+ return super(BaseBaseString, cls).__subclasscheck__(subclass) or issubclass(subclass, (bytes, str))
class basestring(with_metaclass(BaseBaseString)):
diff --git a/src/past/types/oldstr.py b/src/past/types/oldstr.py
index a477d884..5a0e3789 100644
--- a/src/past/types/oldstr.py
+++ b/src/past/types/oldstr.py
@@ -20,7 +20,7 @@ def __instancecheck__(cls, instance):
def unescape(s):
- """
+ r"""
Interprets strings with escape sequences
Example:
diff --git a/tests/test_future/test_backports.py b/tests/test_future/test_backports.py
index 9eeb741b..63b1afea 100644
--- a/tests/test_future/test_backports.py
+++ b/tests/test_future/test_backports.py
@@ -87,7 +87,8 @@ def test_basics(self):
d['b'] = 20
d['c'] = 30
self.assertEqual(d.maps, [{'b':20, 'c':30}, {'a':1, 'b':2}]) # check internal state
- self.assertEqual(d.items(), dict(a=1, b=20, c=30).items()) # check items/iter/getitem
+ self.assertEqual(sorted(d.items()),
+ sorted(dict(a=1, b=20, c=30).items())) # check items/iter/getitem
self.assertEqual(len(d), 3) # check len
for key in 'abc': # check contains
self.assertIn(key, d)
@@ -96,7 +97,8 @@ def test_basics(self):
del d['b'] # unmask a value
self.assertEqual(d.maps, [{'c':30}, {'a':1, 'b':2}]) # check internal state
- self.assertEqual(d.items(), dict(a=1, b=2, c=30).items()) # check items/iter/getitem
+ self.assertEqual(sorted(d.items()),
+ sorted(dict(a=1, b=2, c=30).items())) # check items/iter/getitem
self.assertEqual(len(d), 3) # check len
for key in 'abc': # check contains
self.assertIn(key, d)
diff --git a/tests/test_future/test_builtins.py b/tests/test_future/test_builtins.py
index ca07b9ef..3921a608 100644
--- a/tests/test_future/test_builtins.py
+++ b/tests/test_future/test_builtins.py
@@ -146,7 +146,6 @@ def test_round(self):
self.assertTrue(isinstance(round(123.5, 0), float))
self.assertTrue(isinstance(round(123.5), Integral))
- @unittest.skip('negative ndigits not implemented yet')
def test_round_negative_ndigits(self):
self.assertEqual(round(10.1350, 0), 10.0)
self.assertEqual(round(10.1350, -1), 10.0)
diff --git a/tests/test_future/test_count.py b/tests/test_future/test_count.py
new file mode 100644
index 00000000..cc849bd5
--- /dev/null
+++ b/tests/test_future/test_count.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+"""
+Tests for the backported class:`range` class.
+"""
+from itertools import count as it_count
+
+from future.backports.misc import count
+from future.tests.base import unittest, skip26
+
+
+class CountTest(unittest.TestCase):
+
+ """Test the count function."""
+
+ def _test_count_func(self, func):
+ self.assertEqual(next(func(1)), 1)
+ self.assertEqual(next(func(start=1)), 1)
+
+ c = func()
+ self.assertEqual(next(c), 0)
+ self.assertEqual(next(c), 1)
+ self.assertEqual(next(c), 2)
+ c = func(1, 1)
+ self.assertEqual(next(c), 1)
+ self.assertEqual(next(c), 2)
+ c = func(step=1)
+ self.assertEqual(next(c), 0)
+ self.assertEqual(next(c), 1)
+ c = func(start=1, step=1)
+ self.assertEqual(next(c), 1)
+ self.assertEqual(next(c), 2)
+
+ c = func(-1)
+ self.assertEqual(next(c), -1)
+ self.assertEqual(next(c), 0)
+ self.assertEqual(next(c), 1)
+ c = func(1, -1)
+ self.assertEqual(next(c), 1)
+ self.assertEqual(next(c), 0)
+ self.assertEqual(next(c), -1)
+ c = func(-1, -1)
+ self.assertEqual(next(c), -1)
+ self.assertEqual(next(c), -2)
+ self.assertEqual(next(c), -3)
+
+ def test_count(self):
+ """Test the count function."""
+ self._test_count_func(count)
+
+ @skip26
+ def test_own_count(self):
+ """Test own count implementation."""
+ self._test_count_func(it_count)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/test_future/test_email_generation.py b/tests/test_future/test_email_generation.py
new file mode 100644
index 00000000..10e61138
--- /dev/null
+++ b/tests/test_future/test_email_generation.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+"""Tests for email generation."""
+
+from __future__ import unicode_literals
+
+from future.backports.email.mime.multipart import MIMEMultipart
+from future.backports.email.mime.text import MIMEText
+from future.backports.email.utils import formatdate
+from future.tests.base import unittest
+
+
+class EmailGenerationTests(unittest.TestCase):
+ def test_email_custom_header_can_contain_unicode(self):
+ msg = MIMEMultipart()
+ alternative = MIMEMultipart('alternative')
+ alternative.attach(MIMEText('Plain content with Únicødê', _subtype='plain', _charset='utf-8'))
+ alternative.attach(MIMEText('HTML content with Únicødê', _subtype='html', _charset='utf-8'))
+ msg.attach(alternative)
+
+ msg['Subject'] = 'Subject with Únicødê'
+ msg['From'] = 'sender@test.com'
+ msg['To'] = 'recipient@test.com'
+ msg['Date'] = formatdate(None, localtime=True)
+ msg['Message-ID'] = 'anIdWithÚnicødêForThisEmail'
+
+ msg_lines = msg.as_string().split('\n')
+ self.assertEqual(msg_lines[2], 'Subject: =?utf-8?b?U3ViamVjdCB3aXRoIMOabmljw7hkw6o=?=')
+ self.assertEqual(msg_lines[6], 'Message-ID: =?utf-8?b?YW5JZFdpdGjDmm5pY8O4ZMOqRm9yVGhpc0VtYWls?=')
+ self.assertEqual(msg_lines[17], 'UGxhaW4gY29udGVudCB3aXRoIMOabmljw7hkw6o=')
+ self.assertEqual(msg_lines[24], 'SFRNTCBjb250ZW50IHdpdGggw5puaWPDuGTDqg==')
diff --git a/tests/test_future/test_futurize.py b/tests/test_future/test_futurize.py
index 0d7c42de..c3696a54 100644
--- a/tests/test_future/test_futurize.py
+++ b/tests/test_future/test_futurize.py
@@ -436,6 +436,7 @@ def test_import_builtins(self):
"""
self.convert_check(before, after, ignore_imports=False, run=False)
+ @expectedFailurePY26
def test_input_without_import(self):
before = """
a = input()
diff --git a/tests/test_future/test_libfuturize_fixers.py b/tests/test_future/test_libfuturize_fixers.py
index 4ac0b7e1..2146d1f2 100644
--- a/tests/test_future/test_libfuturize_fixers.py
+++ b/tests/test_future/test_libfuturize_fixers.py
@@ -307,6 +307,37 @@ def test_trailing_comma_3(self):
a = """print(1, end=' ')"""
self.check(b, a)
+ def test_trailing_comma_4(self):
+ b = """print "a ","""
+ a = """print("a ", end=' ')"""
+ self.check(b, a)
+
+ def test_trailing_comma_5(self):
+ b = r"""print "b\t","""
+ a = r"""print("b\t", end='')"""
+ self.check(b, a)
+
+ def test_trailing_comma_6(self):
+ b = r"""print "c\n","""
+ a = r"""print("c\n", end='')"""
+ self.check(b, a)
+
+ def test_trailing_comma_7(self):
+ b = r"""print "d\r","""
+ a = r"""print("d\r", end='')"""
+ self.check(b, a)
+
+ def test_trailing_comma_8(self):
+ b = r"""print "%s\n" % (1,),"""
+ a = r"""print("%s\n" % (1,), end='')"""
+ self.check(b, a)
+
+
+ def test_trailing_comma_9(self):
+ b = r"""print r"e\n","""
+ a = r"""print(r"e\n", end=' ')"""
+ self.check(b, a)
+
# >> stuff
def test_vargs_without_trailing_comma(self):
@@ -767,6 +798,20 @@ def test_unknown_value_with_traceback_with_comments(self):
raise_(E, Func(arg1, arg2, arg3), tb) # foo"""
self.check(b, a)
+ def test_unknown_value_with_indent(self):
+ b = """
+ while True:
+ print() # another expression in the same block triggers different parsing
+ raise E, V
+ """
+ a = """
+ from future.utils import raise_
+ while True:
+ print() # another expression in the same block triggers different parsing
+ raise_(E, V)
+ """
+ self.check(b, a)
+
# These should produce a warning
def test_string_exc(self):
diff --git a/tests/test_future/test_super.py b/tests/test_future/test_super.py
index 0376c1d8..3cb23d69 100644
--- a/tests/test_future/test_super.py
+++ b/tests/test_future/test_super.py
@@ -170,6 +170,18 @@ class Elite(Dangerous):
self.assertEqual(Elite().walk(), 'Defused')
+ def test_metaclass(self):
+ class Meta(type):
+ def __init__(cls, name, bases, clsdict):
+ super().__init__(name, bases, clsdict)
+
+ try:
+ class Base(object):
+ __metaclass__ = Meta
+ except Exception as e:
+ self.fail('raised %s with a custom metaclass'
+ % type(e).__name__)
+
class TestSuperFromTestDescrDotPy(unittest.TestCase):
"""
diff --git a/tests/test_future/test_urllibnet.py b/tests/test_future/test_urllibnet.py
index f9639bfc..6a7b6d64 100644
--- a/tests/test_future/test_urllibnet.py
+++ b/tests/test_future/test_urllibnet.py
@@ -38,7 +38,7 @@ def testURLread(self):
class urlopenNetworkTests(unittest.TestCase):
- """Tests urllib.reqest.urlopen using the network.
+ """Tests urllib.request.urlopen using the network.
These tests are not exhaustive. Assuming that testing using files does a
good job overall of some of the basic interface features. There are no
diff --git a/tests/test_past/test_basestring.py b/tests/test_past/test_basestring.py
index d002095e..6c224b3e 100644
--- a/tests/test_past/test_basestring.py
+++ b/tests/test_past/test_basestring.py
@@ -19,6 +19,25 @@ def test_isinstance(self):
s2 = oldstr(b'abc')
self.assertTrue(isinstance(s2, basestring))
+ def test_issubclass(self):
+ self.assertTrue(issubclass(str, basestring))
+ self.assertTrue(issubclass(bytes, basestring))
+ self.assertTrue(issubclass(basestring, basestring))
+ self.assertFalse(issubclass(int, basestring))
+ self.assertFalse(issubclass(list, basestring))
+ self.assertTrue(issubclass(basestring, object))
+
+ class CustomString(basestring):
+ pass
+ class NotString(object):
+ pass
+ class OldStyleClass:
+ pass
+ self.assertTrue(issubclass(CustomString, basestring))
+ self.assertFalse(issubclass(NotString, basestring))
+ self.assertFalse(issubclass(OldStyleClass, basestring))
+
+
if __name__ == '__main__':
unittest.main()
diff --git a/tests/test_past/test_misc.py b/tests/test_past/test_misc.py
new file mode 100644
index 00000000..0367b3db
--- /dev/null
+++ b/tests/test_past/test_misc.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+"""
+Tests for the resurrected Py2-like cmp function
+"""
+
+from __future__ import absolute_import, unicode_literals, print_function
+
+import os.path
+import sys
+import traceback
+from contextlib import contextmanager
+
+from future.tests.base import unittest
+from future.utils import PY3, PY26
+
+if PY3:
+ from past.builtins import cmp
+
+_dir = os.path.dirname(os.path.abspath(__file__))
+sys.path.append(_dir)
+import test_values
+
+
+@contextmanager
+def empty_context_manager(*args, **kwargs):
+ yield dict(args=args, kwargs=kwargs)
+
+
+class TestCmp(unittest.TestCase):
+ def test_cmp(self):
+ for x, y, cmp_python2_value in test_values.cmp_python2_value:
+ if PY26:
+ # set cmp works a bit differently in 2.6, we try to emulate 2.7 behavior, so skip set cmp tests
+ if isinstance(x, set) or isinstance(y, set):
+ continue
+ # to get this to run on python <3.4 which lacks subTest
+ with getattr(self, 'subTest', empty_context_manager)(x=x, y=y):
+ try:
+ past_cmp_value = cmp(x, y)
+ except Exception:
+ past_cmp_value = traceback.format_exc().strip().split('\n')[-1]
+
+ self.assertEqual(cmp_python2_value, past_cmp_value,
+ "expected result matching python2 __builtins__.cmp({x!r},{y!r}) "
+ "== {cmp_python2_value} "
+ "got past.builtins.cmp({x!r},{y!r}) "
+ "== {past_cmp_value} "
+ "".format(x=x, y=y, past_cmp_value=past_cmp_value,
+ cmp_python2_value=cmp_python2_value))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/test_past/test_values.py b/tests/test_past/test_values.py
new file mode 100644
index 00000000..11872084
--- /dev/null
+++ b/tests/test_past/test_values.py
@@ -0,0 +1,225 @@
+from math import pi
+
+inf, nan = float('inf'), float('nan')
+test_values = [
+ 0, 1, 2, -1, -9999999999, 9999999,
+ 0.0, inf, pi,
+ [], [[]], [1, 2, 3],
+ set(), set([1, 2, 3]),
+ " ", "", "1", "dsada saA.", "2", "dsa", b"", b"dsa", b" ",
+ {5: 3}, dict(), dict(a=99), dict(a=1, b=2, c=3), None
+]
+
+# cmp_python2_values are pre-calculated from running cmp under python2 first values are x and y, last is results of cmp
+cmp_python2_value = [[0, 1, -1], [0, 2, -1], [0, -1, 1], [0, -9999999999999999, 1], [0, 9999999999999999, -1],
+ [0, 0.0, 0], [0, inf, -1], [0, 3.141592653589793, -1], [0, [], -1], [0, [[]], -1],
+ [0, [1, 2, 3], -1], [0, '', -1], [0, ' ', -1], [0, '1', -1], [0, 'a bee cd.', -1], [0, '', -1],
+ [0, ' ', -1], [0, '1', -1], [0, 'a bee cd.', -1], [0, set([]), -1], [0, set([1, 2, 3]), -1],
+ [0, {5: 3}, -1], [0, {}, -1], [0, {'a': 99}, -1], [0, {'a': 1, 'c': 3, 'b': 2}, -1],
+ [0, {'a': 99, 'c': 3, 'b': 5}, -1], [0, None, 1], [1, 0, 1], [1, 2, -1], [1, -1, 1],
+ [1, -9999999999999999, 1], [1, 9999999999999999, -1], [1, 0.0, 1], [1, inf, -1],
+ [1, 3.141592653589793, -1], [1, [], -1], [1, [[]], -1], [1, [1, 2, 3], -1], [1, '', -1],
+ [1, ' ', -1], [1, '1', -1], [1, 'a bee cd.', -1], [1, '', -1], [1, ' ', -1], [1, '1', -1],
+ [1, 'a bee cd.', -1], [1, set([]), -1], [1, set([1, 2, 3]), -1], [1, {5: 3}, -1], [1, {}, -1],
+ [1, {'a': 99}, -1], [1, {'a': 1, 'c': 3, 'b': 2}, -1], [1, {'a': 99, 'c': 3, 'b': 5}, -1],
+ [1, None, 1], [2, 0, 1], [2, 1, 1], [2, -1, 1], [2, -9999999999999999, 1],
+ [2, 9999999999999999, -1], [2, 0.0, 1], [2, inf, -1], [2, 3.141592653589793, -1], [2, [], -1],
+ [2, [[]], -1], [2, [1, 2, 3], -1], [2, '', -1], [2, ' ', -1], [2, '1', -1], [2, 'a bee cd.', -1],
+ [2, '', -1], [2, ' ', -1], [2, '1', -1], [2, 'a bee cd.', -1], [2, set([]), -1],
+ [2, set([1, 2, 3]), -1], [2, {5: 3}, -1], [2, {}, -1], [2, {'a': 99}, -1],
+ [2, {'a': 1, 'c': 3, 'b': 2}, -1], [2, {'a': 99, 'c': 3, 'b': 5}, -1], [2, None, 1], [-1, 0, -1],
+ [-1, 1, -1], [-1, 2, -1], [-1, -9999999999999999, 1], [-1, 9999999999999999, -1], [-1, 0.0, -1],
+ [-1, inf, -1], [-1, 3.141592653589793, -1], [-1, [], -1], [-1, [[]], -1], [-1, [1, 2, 3], -1],
+ [-1, '', -1], [-1, ' ', -1], [-1, '1', -1], [-1, 'a bee cd.', -1], [-1, '', -1], [-1, ' ', -1],
+ [-1, '1', -1], [-1, 'a bee cd.', -1], [-1, set([]), -1], [-1, set([1, 2, 3]), -1],
+ [-1, {5: 3}, -1], [-1, {}, -1], [-1, {'a': 99}, -1], [-1, {'a': 1, 'c': 3, 'b': 2}, -1],
+ [-1, {'a': 99, 'c': 3, 'b': 5}, -1], [-1, None, 1], [-9999999999999999, 0, -1],
+ [-9999999999999999, 1, -1], [-9999999999999999, 2, -1], [-9999999999999999, -1, -1],
+ [-9999999999999999, 9999999999999999, -1], [-9999999999999999, 0.0, -1],
+ [-9999999999999999, inf, -1], [-9999999999999999, 3.141592653589793, -1],
+ [-9999999999999999, [], -1], [-9999999999999999, [[]], -1], [-9999999999999999, [1, 2, 3], -1],
+ [-9999999999999999, '', -1], [-9999999999999999, ' ', -1], [-9999999999999999, '1', -1],
+ [-9999999999999999, 'a bee cd.', -1], [-9999999999999999, '', -1], [-9999999999999999, ' ', -1],
+ [-9999999999999999, '1', -1], [-9999999999999999, 'a bee cd.', -1],
+ [-9999999999999999, set([]), -1], [-9999999999999999, set([1, 2, 3]), -1],
+ [-9999999999999999, {5: 3}, -1], [-9999999999999999, {}, -1], [-9999999999999999, {'a': 99}, -1],
+ [-9999999999999999, {'a': 1, 'c': 3, 'b': 2}, -1],
+ [-9999999999999999, {'a': 99, 'c': 3, 'b': 5}, -1], [-9999999999999999, None, 1],
+ [9999999999999999, 0, 1], [9999999999999999, 1, 1], [9999999999999999, 2, 1],
+ [9999999999999999, -1, 1], [9999999999999999, -9999999999999999, 1], [9999999999999999, 0.0, 1],
+ [9999999999999999, inf, -1], [9999999999999999, 3.141592653589793, 1], [9999999999999999, [], -1],
+ [9999999999999999, [[]], -1], [9999999999999999, [1, 2, 3], -1], [9999999999999999, '', -1],
+ [9999999999999999, ' ', -1], [9999999999999999, '1', -1], [9999999999999999, 'a bee cd.', -1],
+ [9999999999999999, '', -1], [9999999999999999, ' ', -1], [9999999999999999, '1', -1],
+ [9999999999999999, 'a bee cd.', -1], [9999999999999999, set([]), -1],
+ [9999999999999999, set([1, 2, 3]), -1], [9999999999999999, {5: 3}, -1], [9999999999999999, {}, -1],
+ [9999999999999999, {'a': 99}, -1], [9999999999999999, {'a': 1, 'c': 3, 'b': 2}, -1],
+ [9999999999999999, {'a': 99, 'c': 3, 'b': 5}, -1], [9999999999999999, None, 1], [0.0, 0, 0],
+ [0.0, 1, -1], [0.0, 2, -1], [0.0, -1, 1], [0.0, -9999999999999999, 1], [0.0, 9999999999999999, -1],
+ [0.0, inf, -1], [0.0, 3.141592653589793, -1], [0.0, [], -1], [0.0, [[]], -1], [0.0, [1, 2, 3], -1],
+ [0.0, '', -1], [0.0, ' ', -1], [0.0, '1', -1], [0.0, 'a bee cd.', -1], [0.0, '', -1],
+ [0.0, ' ', -1], [0.0, '1', -1], [0.0, 'a bee cd.', -1], [0.0, set([]), -1],
+ [0.0, set([1, 2, 3]), -1], [0.0, {5: 3}, -1], [0.0, {}, -1], [0.0, {'a': 99}, -1],
+ [0.0, {'a': 1, 'c': 3, 'b': 2}, -1], [0.0, {'a': 99, 'c': 3, 'b': 5}, -1], [0.0, None, 1],
+ [inf, 0, 1], [inf, 1, 1], [inf, 2, 1], [inf, -1, 1], [inf, -9999999999999999, 1],
+ [inf, 9999999999999999, 1], [inf, 0.0, 1], [inf, 3.141592653589793, 1], [inf, [], -1],
+ [inf, [[]], -1], [inf, [1, 2, 3], -1], [inf, '', -1], [inf, ' ', -1], [inf, '1', -1],
+ [inf, 'a bee cd.', -1], [inf, '', -1], [inf, ' ', -1], [inf, '1', -1], [inf, 'a bee cd.', -1],
+ [inf, set([]), -1], [inf, set([1, 2, 3]), -1], [inf, {5: 3}, -1], [inf, {}, -1],
+ [inf, {'a': 99}, -1], [inf, {'a': 1, 'c': 3, 'b': 2}, -1], [inf, {'a': 99, 'c': 3, 'b': 5}, -1],
+ [inf, None, 1], [3.141592653589793, 0, 1], [3.141592653589793, 1, 1], [3.141592653589793, 2, 1],
+ [3.141592653589793, -1, 1], [3.141592653589793, -9999999999999999, 1],
+ [3.141592653589793, 9999999999999999, -1], [3.141592653589793, 0.0, 1],
+ [3.141592653589793, inf, -1], [3.141592653589793, [], -1], [3.141592653589793, [[]], -1],
+ [3.141592653589793, [1, 2, 3], -1], [3.141592653589793, '', -1], [3.141592653589793, ' ', -1],
+ [3.141592653589793, '1', -1], [3.141592653589793, 'a bee cd.', -1], [3.141592653589793, '', -1],
+ [3.141592653589793, ' ', -1], [3.141592653589793, '1', -1], [3.141592653589793, 'a bee cd.', -1],
+ [3.141592653589793, set([]), -1], [3.141592653589793, set([1, 2, 3]), -1],
+ [3.141592653589793, {5: 3}, -1], [3.141592653589793, {}, -1], [3.141592653589793, {'a': 99}, -1],
+ [3.141592653589793, {'a': 1, 'c': 3, 'b': 2}, -1],
+ [3.141592653589793, {'a': 99, 'c': 3, 'b': 5}, -1], [3.141592653589793, None, 1], [[], 0, 1],
+ [[], 1, 1], [[], 2, 1], [[], -1, 1], [[], -9999999999999999, 1], [[], 9999999999999999, 1],
+ [[], 0.0, 1], [[], inf, 1], [[], 3.141592653589793, 1], [[], [[]], -1], [[], [1, 2, 3], -1],
+ [[], '', -1], [[], ' ', -1], [[], '1', -1], [[], 'a bee cd.', -1], [[], '', -1], [[], ' ', -1],
+ [[], '1', -1], [[], 'a bee cd.', -1], [[], set([]), -1], [[], set([1, 2, 3]), -1], [[], {5: 3}, 1],
+ [[], {}, 1], [[], {'a': 99}, 1], [[], {'a': 1, 'c': 3, 'b': 2}, 1],
+ [[], {'a': 99, 'c': 3, 'b': 5}, 1], [[], None, 1], [[[]], 0, 1], [[[]], 1, 1], [[[]], 2, 1],
+ [[[]], -1, 1], [[[]], -9999999999999999, 1], [[[]], 9999999999999999, 1], [[[]], 0.0, 1],
+ [[[]], inf, 1], [[[]], 3.141592653589793, 1], [[[]], [], 1], [[[]], [1, 2, 3], 1], [[[]], '', -1],
+ [[[]], ' ', -1], [[[]], '1', -1], [[[]], 'a bee cd.', -1], [[[]], '', -1], [[[]], ' ', -1],
+ [[[]], '1', -1], [[[]], 'a bee cd.', -1], [[[]], set([]), -1], [[[]], set([1, 2, 3]), -1],
+ [[[]], {5: 3}, 1], [[[]], {}, 1], [[[]], {'a': 99}, 1], [[[]], {'a': 1, 'c': 3, 'b': 2}, 1],
+ [[[]], {'a': 99, 'c': 3, 'b': 5}, 1], [[[]], None, 1], [[1, 2, 3], 0, 1], [[1, 2, 3], 1, 1],
+ [[1, 2, 3], 2, 1], [[1, 2, 3], -1, 1], [[1, 2, 3], -9999999999999999, 1],
+ [[1, 2, 3], 9999999999999999, 1], [[1, 2, 3], 0.0, 1], [[1, 2, 3], inf, 1],
+ [[1, 2, 3], 3.141592653589793, 1], [[1, 2, 3], [], 1], [[1, 2, 3], [[]], -1], [[1, 2, 3], '', -1],
+ [[1, 2, 3], ' ', -1], [[1, 2, 3], '1', -1], [[1, 2, 3], 'a bee cd.', -1], [[1, 2, 3], '', -1],
+ [[1, 2, 3], ' ', -1], [[1, 2, 3], '1', -1], [[1, 2, 3], 'a bee cd.', -1], [[1, 2, 3], set([]), -1],
+ [[1, 2, 3], set([1, 2, 3]), -1], [[1, 2, 3], {5: 3}, 1], [[1, 2, 3], {}, 1],
+ [[1, 2, 3], {'a': 99}, 1], [[1, 2, 3], {'a': 1, 'c': 3, 'b': 2}, 1],
+ [[1, 2, 3], {'a': 99, 'c': 3, 'b': 5}, 1], [[1, 2, 3], None, 1], ['', 0, 1], ['', 1, 1],
+ ['', 2, 1], ['', -1, 1], ['', -9999999999999999, 1], ['', 9999999999999999, 1], ['', 0.0, 1],
+ ['', inf, 1], ['', 3.141592653589793, 1], ['', [], 1], ['', [[]], 1], ['', [1, 2, 3], 1],
+ ['', ' ', -1], ['', '1', -1], ['', 'a bee cd.', -1], ['', '', 0], ['', ' ', -1], ['', '1', -1],
+ ['', 'a bee cd.', -1], ['', set([]), 1], ['', set([1, 2, 3]), 1], ['', {5: 3}, 1], ['', {}, 1],
+ ['', {'a': 99}, 1], ['', {'a': 1, 'c': 3, 'b': 2}, 1], ['', {'a': 99, 'c': 3, 'b': 5}, 1],
+ ['', None, 1], [' ', 0, 1], [' ', 1, 1], [' ', 2, 1], [' ', -1, 1], [' ', -9999999999999999, 1],
+ [' ', 9999999999999999, 1], [' ', 0.0, 1], [' ', inf, 1], [' ', 3.141592653589793, 1],
+ [' ', [], 1], [' ', [[]], 1], [' ', [1, 2, 3], 1], [' ', '', 1], [' ', '1', -1],
+ [' ', 'a bee cd.', -1], [' ', '', 1], [' ', ' ', 0], [' ', '1', -1], [' ', 'a bee cd.', -1],
+ [' ', set([]), 1], [' ', set([1, 2, 3]), 1], [' ', {5: 3}, 1], [' ', {}, 1], [' ', {'a': 99}, 1],
+ [' ', {'a': 1, 'c': 3, 'b': 2}, 1], [' ', {'a': 99, 'c': 3, 'b': 5}, 1], [' ', None, 1],
+ ['1', 0, 1], ['1', 1, 1], ['1', 2, 1], ['1', -1, 1], ['1', -9999999999999999, 1],
+ ['1', 9999999999999999, 1], ['1', 0.0, 1], ['1', inf, 1], ['1', 3.141592653589793, 1],
+ ['1', [], 1], ['1', [[]], 1], ['1', [1, 2, 3], 1], ['1', '', 1], ['1', ' ', 1],
+ ['1', 'a bee cd.', -1], ['1', '', 1], ['1', ' ', 1], ['1', '1', 0], ['1', 'a bee cd.', -1],
+ ['1', set([]), 1], ['1', set([1, 2, 3]), 1], ['1', {5: 3}, 1], ['1', {}, 1], ['1', {'a': 99}, 1],
+ ['1', {'a': 1, 'c': 3, 'b': 2}, 1], ['1', {'a': 99, 'c': 3, 'b': 5}, 1], ['1', None, 1],
+ ['a bee cd.', 0, 1], ['a bee cd.', 1, 1], ['a bee cd.', 2, 1], ['a bee cd.', -1, 1],
+ ['a bee cd.', -9999999999999999, 1], ['a bee cd.', 9999999999999999, 1], ['a bee cd.', 0.0, 1],
+ ['a bee cd.', inf, 1], ['a bee cd.', 3.141592653589793, 1], ['a bee cd.', [], 1],
+ ['a bee cd.', [[]], 1], ['a bee cd.', [1, 2, 3], 1], ['a bee cd.', '', 1], ['a bee cd.', ' ', 1],
+ ['a bee cd.', '1', 1], ['a bee cd.', '', 1], ['a bee cd.', ' ', 1], ['a bee cd.', '1', 1],
+ ['a bee cd.', 'a bee cd.', 0], ['a bee cd.', set([]), 1], ['a bee cd.', set([1, 2, 3]), 1],
+ ['a bee cd.', {5: 3}, 1], ['a bee cd.', {}, 1], ['a bee cd.', {'a': 99}, 1],
+ ['a bee cd.', {'a': 1, 'c': 3, 'b': 2}, 1], ['a bee cd.', {'a': 99, 'c': 3, 'b': 5}, 1],
+ ['a bee cd.', None, 1], ['', 0, 1], ['', 1, 1], ['', 2, 1], ['', -1, 1],
+ ['', -9999999999999999, 1], ['', 9999999999999999, 1], ['', 0.0, 1], ['', inf, 1],
+ ['', 3.141592653589793, 1], ['', [], 1], ['', [[]], 1], ['', [1, 2, 3], 1], ['', '', 0],
+ ['', ' ', -1], ['', '1', -1], ['', 'a bee cd.', -1], ['', ' ', -1], ['', '1', -1],
+ ['', 'a bee cd.', -1], ['', set([]), 1], ['', set([1, 2, 3]), 1], ['', {5: 3}, 1], ['', {}, 1],
+ ['', {'a': 99}, 1], ['', {'a': 1, 'c': 3, 'b': 2}, 1], ['', {'a': 99, 'c': 3, 'b': 5}, 1],
+ ['', None, 1], [' ', 0, 1], [' ', 1, 1], [' ', 2, 1], [' ', -1, 1], [' ', -9999999999999999, 1],
+ [' ', 9999999999999999, 1], [' ', 0.0, 1], [' ', inf, 1], [' ', 3.141592653589793, 1],
+ [' ', [], 1], [' ', [[]], 1], [' ', [1, 2, 3], 1], [' ', '', 1], [' ', ' ', 0], [' ', '1', -1],
+ [' ', 'a bee cd.', -1], [' ', '', 1], [' ', '1', -1], [' ', 'a bee cd.', -1], [' ', set([]), 1],
+ [' ', set([1, 2, 3]), 1], [' ', {5: 3}, 1], [' ', {}, 1], [' ', {'a': 99}, 1],
+ [' ', {'a': 1, 'c': 3, 'b': 2}, 1], [' ', {'a': 99, 'c': 3, 'b': 5}, 1], [' ', None, 1],
+ ['1', 0, 1], ['1', 1, 1], ['1', 2, 1], ['1', -1, 1], ['1', -9999999999999999, 1],
+ ['1', 9999999999999999, 1], ['1', 0.0, 1], ['1', inf, 1], ['1', 3.141592653589793, 1],
+ ['1', [], 1], ['1', [[]], 1], ['1', [1, 2, 3], 1], ['1', '', 1], ['1', ' ', 1], ['1', '1', 0],
+ ['1', 'a bee cd.', -1], ['1', '', 1], ['1', ' ', 1], ['1', 'a bee cd.', -1], ['1', set([]), 1],
+ ['1', set([1, 2, 3]), 1], ['1', {5: 3}, 1], ['1', {}, 1], ['1', {'a': 99}, 1],
+ ['1', {'a': 1, 'c': 3, 'b': 2}, 1], ['1', {'a': 99, 'c': 3, 'b': 5}, 1], ['1', None, 1],
+ ['a bee cd.', 0, 1], ['a bee cd.', 1, 1], ['a bee cd.', 2, 1], ['a bee cd.', -1, 1],
+ ['a bee cd.', -9999999999999999, 1], ['a bee cd.', 9999999999999999, 1], ['a bee cd.', 0.0, 1],
+ ['a bee cd.', inf, 1], ['a bee cd.', 3.141592653589793, 1], ['a bee cd.', [], 1],
+ ['a bee cd.', [[]], 1], ['a bee cd.', [1, 2, 3], 1], ['a bee cd.', '', 1], ['a bee cd.', ' ', 1],
+ ['a bee cd.', '1', 1], ['a bee cd.', 'a bee cd.', 0], ['a bee cd.', '', 1], ['a bee cd.', ' ', 1],
+ ['a bee cd.', '1', 1], ['a bee cd.', set([]), 1], ['a bee cd.', set([1, 2, 3]), 1],
+ ['a bee cd.', {5: 3}, 1], ['a bee cd.', {}, 1], ['a bee cd.', {'a': 99}, 1],
+ ['a bee cd.', {'a': 1, 'c': 3, 'b': 2}, 1], ['a bee cd.', {'a': 99, 'c': 3, 'b': 5}, 1],
+ ['a bee cd.', None, 1], [set([]), 0, 1], [set([]), 1, 1], [set([]), 2, 1], [set([]), -1, 1],
+ [set([]), -9999999999999999, 1], [set([]), 9999999999999999, 1], [set([]), 0.0, 1],
+ [set([]), inf, 1], [set([]), 3.141592653589793, 1], [set([]), [], 1], [set([]), [[]], 1],
+ [set([]), [1, 2, 3], 1], [set([]), '', -1], [set([]), ' ', -1], [set([]), '1', -1],
+ [set([]), 'a bee cd.', -1], [set([]), '', -1], [set([]), ' ', -1], [set([]), '1', -1],
+ [set([]), 'a bee cd.', -1],
+ [set([]), set([1, 2, 3]), 'TypeError: cannot compare sets using cmp()'], [set([]), {5: 3}, 1],
+ [set([]), {}, 1], [set([]), {'a': 99}, 1], [set([]), {'a': 1, 'c': 3, 'b': 2}, 1],
+ [set([]), {'a': 99, 'c': 3, 'b': 5}, 1], [set([]), None, 1], [set([1, 2, 3]), 0, 1],
+ [set([1, 2, 3]), 1, 1], [set([1, 2, 3]), 2, 1], [set([1, 2, 3]), -1, 1],
+ [set([1, 2, 3]), -9999999999999999, 1], [set([1, 2, 3]), 9999999999999999, 1],
+ [set([1, 2, 3]), 0.0, 1], [set([1, 2, 3]), inf, 1], [set([1, 2, 3]), 3.141592653589793, 1],
+ [set([1, 2, 3]), [], 1], [set([1, 2, 3]), [[]], 1], [set([1, 2, 3]), [1, 2, 3], 1],
+ [set([1, 2, 3]), '', -1], [set([1, 2, 3]), ' ', -1], [set([1, 2, 3]), '1', -1],
+ [set([1, 2, 3]), 'a bee cd.', -1], [set([1, 2, 3]), '', -1], [set([1, 2, 3]), ' ', -1],
+ [set([1, 2, 3]), '1', -1], [set([1, 2, 3]), 'a bee cd.', -1],
+ [set([1, 2, 3]), set([]), 'TypeError: cannot compare sets using cmp()'],
+ [set([1, 2, 3]), {5: 3}, 1], [set([1, 2, 3]), {}, 1], [set([1, 2, 3]), {'a': 99}, 1],
+ [set([1, 2, 3]), {'a': 1, 'c': 3, 'b': 2}, 1], [set([1, 2, 3]), {'a': 99, 'c': 3, 'b': 5}, 1],
+ [set([1, 2, 3]), None, 1], [{5: 3}, 0, 1], [{5: 3}, 1, 1], [{5: 3}, 2, 1], [{5: 3}, -1, 1],
+ [{5: 3}, -9999999999999999, 1], [{5: 3}, 9999999999999999, 1], [{5: 3}, 0.0, 1], [{5: 3}, inf, 1],
+ [{5: 3}, 3.141592653589793, 1], [{5: 3}, [], -1], [{5: 3}, [[]], -1], [{5: 3}, [1, 2, 3], -1],
+ [{5: 3}, '', -1], [{5: 3}, ' ', -1], [{5: 3}, '1', -1], [{5: 3}, 'a bee cd.', -1],
+ [{5: 3}, '', -1], [{5: 3}, ' ', -1], [{5: 3}, '1', -1], [{5: 3}, 'a bee cd.', -1],
+ [{5: 3}, set([]), -1], [{5: 3}, set([1, 2, 3]), -1], [{5: 3}, {}, 1], [{5: 3}, {'a': 99}, -1],
+ [{5: 3}, {'a': 1, 'c': 3, 'b': 2}, -1], [{5: 3}, {'a': 99, 'c': 3, 'b': 5}, -1], [{5: 3}, None, 1],
+ [{}, 0, 1], [{}, 1, 1], [{}, 2, 1], [{}, -1, 1], [{}, -9999999999999999, 1],
+ [{}, 9999999999999999, 1], [{}, 0.0, 1], [{}, inf, 1], [{}, 3.141592653589793, 1], [{}, [], -1],
+ [{}, [[]], -1], [{}, [1, 2, 3], -1], [{}, '', -1], [{}, ' ', -1], [{}, '1', -1],
+ [{}, 'a bee cd.', -1], [{}, '', -1], [{}, ' ', -1], [{}, '1', -1], [{}, 'a bee cd.', -1],
+ [{}, set([]), -1], [{}, set([1, 2, 3]), -1], [{}, {5: 3}, -1], [{}, {'a': 99}, -1],
+ [{}, {'a': 1, 'c': 3, 'b': 2}, -1], [{}, {'a': 99, 'c': 3, 'b': 5}, -1], [{}, None, 1],
+ [{'a': 99}, 0, 1], [{'a': 99}, 1, 1], [{'a': 99}, 2, 1], [{'a': 99}, -1, 1],
+ [{'a': 99}, -9999999999999999, 1], [{'a': 99}, 9999999999999999, 1], [{'a': 99}, 0.0, 1],
+ [{'a': 99}, inf, 1], [{'a': 99}, 3.141592653589793, 1], [{'a': 99}, [], -1], [{'a': 99}, [[]], -1],
+ [{'a': 99}, [1, 2, 3], -1], [{'a': 99}, '', -1], [{'a': 99}, ' ', -1], [{'a': 99}, '1', -1],
+ [{'a': 99}, 'a bee cd.', -1], [{'a': 99}, '', -1], [{'a': 99}, ' ', -1], [{'a': 99}, '1', -1],
+ [{'a': 99}, 'a bee cd.', -1], [{'a': 99}, set([]), -1], [{'a': 99}, set([1, 2, 3]), -1],
+ [{'a': 99}, {5: 3}, 1], [{'a': 99}, {}, 1], [{'a': 99}, {'a': 1, 'c': 3, 'b': 2}, -1],
+ [{'a': 99}, {'a': 99, 'c': 3, 'b': 5}, -1], [{'a': 99}, None, 1], [{'a': 1, 'c': 3, 'b': 2}, 0, 1],
+ [{'a': 1, 'c': 3, 'b': 2}, 1, 1], [{'a': 1, 'c': 3, 'b': 2}, 2, 1],
+ [{'a': 1, 'c': 3, 'b': 2}, -1, 1], [{'a': 1, 'c': 3, 'b': 2}, -9999999999999999, 1],
+ [{'a': 1, 'c': 3, 'b': 2}, 9999999999999999, 1], [{'a': 1, 'c': 3, 'b': 2}, 0.0, 1],
+ [{'a': 1, 'c': 3, 'b': 2}, inf, 1], [{'a': 1, 'c': 3, 'b': 2}, 3.141592653589793, 1],
+ [{'a': 1, 'c': 3, 'b': 2}, [], -1], [{'a': 1, 'c': 3, 'b': 2}, [[]], -1],
+ [{'a': 1, 'c': 3, 'b': 2}, [1, 2, 3], -1], [{'a': 1, 'c': 3, 'b': 2}, '', -1],
+ [{'a': 1, 'c': 3, 'b': 2}, ' ', -1], [{'a': 1, 'c': 3, 'b': 2}, '1', -1],
+ [{'a': 1, 'c': 3, 'b': 2}, 'a bee cd.', -1], [{'a': 1, 'c': 3, 'b': 2}, '', -1],
+ [{'a': 1, 'c': 3, 'b': 2}, ' ', -1], [{'a': 1, 'c': 3, 'b': 2}, '1', -1],
+ [{'a': 1, 'c': 3, 'b': 2}, 'a bee cd.', -1], [{'a': 1, 'c': 3, 'b': 2}, set([]), -1],
+ [{'a': 1, 'c': 3, 'b': 2}, set([1, 2, 3]), -1], [{'a': 1, 'c': 3, 'b': 2}, {5: 3}, 1],
+ [{'a': 1, 'c': 3, 'b': 2}, {}, 1], [{'a': 1, 'c': 3, 'b': 2}, {'a': 99}, 1],
+ [{'a': 1, 'c': 3, 'b': 2}, {'a': 99, 'c': 3, 'b': 5}, -1], [{'a': 1, 'c': 3, 'b': 2}, None, 1],
+ [{'a': 99, 'c': 3, 'b': 5}, 0, 1], [{'a': 99, 'c': 3, 'b': 5}, 1, 1],
+ [{'a': 99, 'c': 3, 'b': 5}, 2, 1], [{'a': 99, 'c': 3, 'b': 5}, -1, 1],
+ [{'a': 99, 'c': 3, 'b': 5}, -9999999999999999, 1],
+ [{'a': 99, 'c': 3, 'b': 5}, 9999999999999999, 1], [{'a': 99, 'c': 3, 'b': 5}, 0.0, 1],
+ [{'a': 99, 'c': 3, 'b': 5}, inf, 1], [{'a': 99, 'c': 3, 'b': 5}, 3.141592653589793, 1],
+ [{'a': 99, 'c': 3, 'b': 5}, [], -1], [{'a': 99, 'c': 3, 'b': 5}, [[]], -1],
+ [{'a': 99, 'c': 3, 'b': 5}, [1, 2, 3], -1], [{'a': 99, 'c': 3, 'b': 5}, '', -1],
+ [{'a': 99, 'c': 3, 'b': 5}, ' ', -1], [{'a': 99, 'c': 3, 'b': 5}, '1', -1],
+ [{'a': 99, 'c': 3, 'b': 5}, 'a bee cd.', -1], [{'a': 99, 'c': 3, 'b': 5}, '', -1],
+ [{'a': 99, 'c': 3, 'b': 5}, ' ', -1], [{'a': 99, 'c': 3, 'b': 5}, '1', -1],
+ [{'a': 99, 'c': 3, 'b': 5}, 'a bee cd.', -1], [{'a': 99, 'c': 3, 'b': 5}, set([]), -1],
+ [{'a': 99, 'c': 3, 'b': 5}, set([1, 2, 3]), -1], [{'a': 99, 'c': 3, 'b': 5}, {5: 3}, 1],
+ [{'a': 99, 'c': 3, 'b': 5}, {}, 1], [{'a': 99, 'c': 3, 'b': 5}, {'a': 99}, 1],
+ [{'a': 99, 'c': 3, 'b': 5}, {'a': 1, 'c': 3, 'b': 2}, 1], [{'a': 99, 'c': 3, 'b': 5}, None, 1],
+ [None, 0, -1], [None, 1, -1], [None, 2, -1], [None, -1, -1], [None, -9999999999999999, -1],
+ [None, 9999999999999999, -1], [None, 0.0, -1], [None, inf, -1], [None, 3.141592653589793, -1],
+ [None, [], -1], [None, [[]], -1], [None, [1, 2, 3], -1], [None, '', -1], [None, ' ', -1],
+ [None, '1', -1], [None, 'a bee cd.', -1], [None, '', -1], [None, ' ', -1], [None, '1', -1],
+ [None, 'a bee cd.', -1], [None, set([]), -1], [None, set([1, 2, 3]), -1], [None, {5: 3}, -1],
+ [None, {}, -1], [None, {'a': 99}, -1], [None, {'a': 1, 'c': 3, 'b': 2}, -1],
+ [None, {'a': 99, 'c': 3, 'b': 5}, -1]]
diff --git a/tox.ini b/tox.ini
deleted file mode 100644
index f5c013f8..00000000
--- a/tox.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[tox]
-envlist = py26,py27,py33,py34,py35,py36,py37
-
-[testenv]
-deps =
- pytest
- unittest2
- py26: importlib
-commands = pytest {posargs}
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy