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

Failing unit tests on Debian - AttributeError: 'NoneType' object has no attribute 'secondaries'

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.5
    • Affects Version/s: 3.4
    • Component/s: Tests
    • None
    • Fully Compatible

      Hi,
      the unit tests in mongo-python-driver 3.4 are failing on Debian Linux

      Failing tests:
      test_gridfs (unittest.loader._FailedTest) ... ERROR
      test_gridfs_bucket (unittest.loader._FailedTest) ... ERROR
      test_monitoring (unittest.loader._FailedTest) ... ERROR
      test_read_preferences (unittest.loader._FailedTest) ... ERROR
      test_replica_set_client (unittest.loader._FailedTest) ... ERROR

      Traceback:
      ======================================================================
      ERROR: test_read_preferences (unittest.loader.ModuleImportFailure)
      ----------------------------------------------------------------------
      ImportError: Failed to import test module: test_read_preferences
      Traceback (most recent call last):
      File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
      module = self._get_module_from_name(name)
      File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
      _import_(name)
      File "/home/fede/pymongo/test/test_read_preferences.py", line 39, in <module>
      from test.test_replica_set_client import TestReplicaSetClientBase
      File "/home/fede/pymongo/test/test_replica_set_client.py", line 83, in <module>
      class TestReplicaSetClient(TestReplicaSetClientBase):
      File "/home/fede/pymongo/test/test_replica_set_client.py", line 163, in TestReplicaSetClient
      @client_context.require_secondaries_count(1)
      File "/home/fede/pymongo/test/_init_.py", line 378, in require_secondaries_count
      sec_count = len(self.client.secondaries)
      AttributeError: 'NoneType' object has no attribute 'secondaries'

      Steps to reproduce:
      git clone git://github.com/mongodb/mongo-python-driver.git pymongo && cd pymongo && tox -epy27

      The same errors and traceback are generated using tox -epy35 and/or using sources from the 3.4.0 tarball.

      Environment: Debian Sid
      Python versions: 2.7.13 3.5.1

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            federico2 Federico Ceratto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: