Opened 4 months ago

Closed 4 months ago

#27030 closed defect (fixed)

Potential py3 compatibility issue with LinkProtocol

Reported by: dmr Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords: client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Seeing what looks to be a py3 compatibility issue with #26432. (24206c3b7301ed2fbd2a0bd539f951453dea5684)
Test output for py35:

test_attributes                                              [FAILURE]
...
test_use_as_int                                              [FAILURE]

======================================================================
ERROR: test_attributes
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/path/to/test/unit/client/link_protocol.py", line 17, in test_attributes
    self.assertEqual(Size.SHORT, protocol.circ_id_size)
  File "/usr/lib/python3.5/unittest/case.py", line 821, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.5/unittest/case.py", line 811, in _baseAssertEqual
    if not first == second:
  File "/path/to/stem/client/datatype.py", line 326, in __eq__
    return hash(self) == hash(other) if isinstance(other, Field) else False
TypeError: unhashable type: 'Size'

======================================================================
FAIL: test_use_as_int
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/path/to/test/unit/client/link_protocol.py", line 33, in test_use_as_int
    self.assertEqual(1, protocol / 3)
AssertionError: 1 != 1.6666666666666667

----------------------------------------------------------------------
Ran 4 tests in 0.001s

FAILED (failures=1, errors=1)

...

TESTING FAILED (8 seconds)
  [UNIT TEST] test_attributes (test.unit.client.link_protocol.TestLinkProtocol) ... ERROR
  [UNIT TEST] test_use_as_int (test.unit.client.link_protocol.TestLinkProtocol) ... FAIL

py27 tests pass.

Child Tickets

Change History (1)

comment:1 Changed 4 months ago by atagar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.