pytestconfig = <_pytest.config.Config object at 0x7f36448ee320>
@pytest.fixture(scope='function')
def mongodb(pytestconfig):
dbname = pytestconfig.getoption('mongodb_dbname') or pytestconfig.getini('mongodb_dbname')
client = make_mongo_client(pytestconfig)
db = client[dbname]
> clean_database(db)
.tox/py3/lib/python3.7/site-packages/pytest_mongodb/plugin.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/pytest_mongodb/plugin.py:86: in clean_database
for name in list_collection_names(db):
.tox/py3/lib/python3.7/site-packages/pytest_mongodb/plugin.py:92: in list_collection_names
return db.list_collection_names()
.tox/py3/lib/python3.7/site-packages/pymongo/database.py:880: in list_collection_names
for result in self.list_collections(session=session, **kwargs)]
.tox/py3/lib/python3.7/site-packages/pymongo/database.py:843: in list_collections
_cmd, read_pref, session)
.tox/py3/lib/python3.7/site-packages/pymongo/mongo_client.py:1515: in _retryable_read
read_pref, session, address=address)
.tox/py3/lib/python3.7/site-packages/pymongo/mongo_client.py:1346: in _select_server
server = topology.select_server(server_selector)
.tox/py3/lib/python3.7/site-packages/pymongo/topology.py:246: in select_server
address))
.tox/py3/lib/python3.7/site-packages/pymongo/topology.py:203: in select_servers
selector, server_timeout, address)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Topology <TopologyDescription id: 611f9dbd26cad9279d9fdd32, topology_type: Single, servers: [<ServerDescription ('loc...st', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: [Errno 111] Connection refused')>]>>
selector = Primary(), timeout = 30, address = None
def _select_servers_loop(self, selector, timeout, address):
"""select_servers() guts. Hold the lock when calling this."""
now = _time()
end_time = now + timeout
server_descriptions = self._description.apply_selector(
selector, address, custom_selector=self._settings.server_selector)
while not server_descriptions:
# No suitable servers.
if timeout == 0 or now > end_time:
raise ServerSelectionTimeoutError(
"%s, Timeout: %ss, Topology Description: %r" %
> (self._error_message(selector), timeout, self.description))
E pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 611f9dbd26cad9279d9fdd32, topology_type: Single, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: [Errno 111] Connection refused')>]>
.tox/py3/lib/python3.7/site-packages/pymongo/topology.py:220: ServerSelectionTimeoutError
TEST RESULT
TEST RESULT
- Run At
- Aug 20 2021, 2:25 PM