Skip to content

Tests failing on Python 2 #656

@lwfitzgerald

Description

@lwfitzgerald

Tests are failing on the 3.7.4 tag on Python 2

# python --version
Python 2.7.13 :: Continuum Analytics, Inc.
# python test_typing.py
.................................................................................................................................................................E.......E..E..........................................................
======================================================================
ERROR: test_protocol_instance_works (__main__.ProtocolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_typing.py", line 1057, in test_protocol_instance_works
    self.assertNotIsInstance('no', typing.SupportsAbs)
  File "/usr/lib/python2.7/unittest/case.py", line 971, in assertNotIsInstance
    if isinstance(obj, cls):
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1824, in __instancecheck__
    issubclass(instance.__class__, self)):
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1847, in __subclasscheck__
    return super(_ProtocolMeta, self).__subclasscheck__(cls)
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1407, in __subclasscheck__
    return super(GenericMeta, self).__subclasscheck__(cls)
  File "/usr/lib/python2.7/abc.py", line 180, in __subclasscheck__
    if issubclass(subclass, scls):
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1847, in __subclasscheck__
    return super(_ProtocolMeta, self).__subclasscheck__(cls)
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1401, in __subclasscheck__
    raise TypeError("Parameterized generics cannot be used with class "
TypeError: Parameterized generics cannot be used with class or instance checks

======================================================================
ERROR: test_reversible (__main__.ProtocolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_typing.py", line 1049, in test_reversible
    self.assertNotIsSubclass(int, typing.Reversible)
  File "test_typing.py", line 42, in assertNotIsSubclass
    if issubclass(cls, class_or_tuple):
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1847, in __subclasscheck__
    return super(_ProtocolMeta, self).__subclasscheck__(cls)
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1407, in __subclasscheck__
    return super(GenericMeta, self).__subclasscheck__(cls)
  File "/usr/lib/python2.7/abc.py", line 180, in __subclasscheck__
    if issubclass(subclass, scls):
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1847, in __subclasscheck__
    return super(_ProtocolMeta, self).__subclasscheck__(cls)
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1401, in __subclasscheck__
    raise TypeError("Parameterized generics cannot be used with class "
TypeError: Parameterized generics cannot be used with class or instance checks

======================================================================
ERROR: test_supports_abs (__main__.ProtocolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_typing.py", line 1045, in test_supports_abs
    self.assertNotIsSubclass(str, typing.SupportsAbs)
  File "test_typing.py", line 42, in assertNotIsSubclass
    if issubclass(cls, class_or_tuple):
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1847, in __subclasscheck__
    return super(_ProtocolMeta, self).__subclasscheck__(cls)
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1407, in __subclasscheck__
    return super(GenericMeta, self).__subclasscheck__(cls)
  File "/usr/lib/python2.7/abc.py", line 180, in __subclasscheck__
    if issubclass(subclass, scls):
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1847, in __subclasscheck__
    return super(_ProtocolMeta, self).__subclasscheck__(cls)
  File "/home/lwfitzgerald/typing/python2/typing.py", line 1401, in __subclasscheck__
    raise TypeError("Parameterized generics cannot be used with class "
TypeError: Parameterized generics cannot be used with class or instance checks

----------------------------------------------------------------------
Ran 231 tests in 0.339s

FAILED (errors=3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions