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

Tests should pass with no MongoDB cluster running

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • 3.5
    • Affects Version/s: None
    • Component/s: Tests
    • None
    • Fully Compatible

      After the changes in PYTHON-1026, the tests no longer pass when there is no MongoDB cluster running:

      ERROR: test_replica_set_client (unittest2.loader.ModuleImportFailure)
      ----------------------------------------------------------------------
      ImportError: Failed to import test module: test_replica_set_client
      Traceback (most recent call last):
        File "/Users/shane/git/mongo-python-driver/.eggs/unittest2-0.8.0-py2.6.egg/unittest2/loader.py", line 445, in _find_test_path
          module = self._get_module_from_name(name)
        File "/Users/shane/git/mongo-python-driver/.eggs/unittest2-0.8.0-py2.6.egg/unittest2/loader.py", line 384, in _get_module_from_name
          __import__(name)
        File "/Users/shane/git/mongo-python-driver/test/test_replica_set_client.py", line 83, in <module>
          class TestReplicaSetClient(TestReplicaSetClientBase):
        File "/Users/shane/git/mongo-python-driver/test/test_replica_set_client.py", line 163, in TestReplicaSetClient
          @client_context.require_secondaries_count(1)
        File "/Users/shane/git/mongo-python-driver/test/__init__.py", line 378, in require_secondaries_count
          sec_count = len(self.client.secondaries)
      AttributeError: 'NoneType' object has no attribute 'secondaries'
      

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

              Created:
              Updated:
              Resolved: