| Index: third_party/six/test_six.py
|
| diff --git a/third_party/six/test_six.py b/third_party/six/test_six.py
|
| index 76a8ccbcd44a96c542b55b9a65b6cbdb936ff796..b68e0069d05ad56152fcc60d3a66d1fbaefda0d2 100644
|
| --- a/third_party/six/test_six.py
|
| +++ b/third_party/six/test_six.py
|
| @@ -1,3 +1,23 @@
|
| +# Copyright (c) 2010-2015 Benjamin Peterson
|
| +#
|
| +# Permission is hereby granted, free of charge, to any person obtaining a copy
|
| +# of this software and associated documentation files (the "Software"), to deal
|
| +# in the Software without restriction, including without limitation the rights
|
| +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| +# copies of the Software, and to permit persons to whom the Software is
|
| +# furnished to do so, subject to the following conditions:
|
| +#
|
| +# The above copyright notice and this permission notice shall be included in all
|
| +# copies or substantial portions of the Software.
|
| +#
|
| +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| +# SOFTWARE.
|
| +
|
| import operator
|
| import sys
|
| import types
|
| @@ -390,7 +410,7 @@ def test_dictionary_iterators(monkeypatch):
|
| monkeypatch.undo()
|
|
|
|
|
| -@py.test.mark.skipif(sys.version_info[:2] < (2, 7),
|
| +@py.test.mark.skipif("sys.version_info[:2] < (2, 7)",
|
| reason="view methods on dictionaries only available on 2.7+")
|
| def test_dictionary_views():
|
| def stock_method_name(viewwhat):
|
| @@ -456,6 +476,20 @@ def test_create_bound_method():
|
| assert b() is x
|
|
|
|
|
| +def test_create_unbound_method():
|
| + class X(object):
|
| + pass
|
| +
|
| + def f(self):
|
| + return self
|
| + u = six.create_unbound_method(f, X)
|
| + py.test.raises(TypeError, u)
|
| + if six.PY2:
|
| + assert isinstance(u, types.MethodType)
|
| + x = X()
|
| + assert f(x) is x
|
| +
|
| +
|
| if six.PY3:
|
|
|
| def test_b():
|
| @@ -497,7 +531,7 @@ def test_unichr():
|
|
|
| def test_int2byte():
|
| assert six.int2byte(3) == six.b("\x03")
|
| - py.test.raises((OverflowError, ValueError), six.int2byte, 256)
|
| + py.test.raises(Exception, six.int2byte, 256)
|
|
|
|
|
| def test_byte2int():
|
| @@ -799,7 +833,7 @@ def test_add_metaclass():
|
| assert type(MySlotsWeakref) is Meta
|
|
|
|
|
| -@py.test.mark.skipif("sys.version_info[:2] < (2, 7)")
|
| +@py.test.mark.skipif("sys.version_info[:2] < (2, 7) or sys.version_info[:2] in ((3, 0), (3, 1))")
|
| def test_assertCountEqual():
|
| class TestAssertCountEqual(unittest.TestCase):
|
| def test(self):
|
|
|