Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1235

Test Failure - test.test_replica_set_client.TestReplicaSetClient.test_auto_reconnect_exception_when_read_preference_is_secondary (Jython)

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.9.5, 3.5
    • Affects Version/s: None
    • Component/s: Tests
    • None

      In Jython socket.socket is a function, not a class. This causes the following test failure:

      ======================================================================
      ERROR: test_auto_reconnect_exception_when_read_preference_is_secondary (test.test_replica_set_client.TestReplicaSetClient)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "test/__init__.py", line 326, in wrap
          return f(*args, **kwargs)
        File "test/test_replica_set_client.py", line 174, in test_auto_reconnect_exception_when_read_preference_is_secondary
          old_sendall = socket.socket.sendall
      AttributeError: 'function' object has no attribute 'sendall'
      

      We can easily fix this by modifying the __class__ of an instance instead.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: