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)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 2.9.5, 3.5
    • Tests
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: