diff --git a/vcr/patch.py b/vcr/patch.py index a9e86bd..68701a3 100644 --- a/vcr/patch.py +++ b/vcr/patch.py @@ -372,10 +372,6 @@ class ConnectionRemover: if isinstance(connection, self._connection_class): self._connection_pool_to_connections.setdefault(pool, set()).add(connection) - def remove_connection_to_pool_entry(self, pool, connection): - if isinstance(connection, self._connection_class): - self._connection_pool_to_connections[self._connection_class].remove(connection) - def __enter__(self): return self @@ -386,6 +382,7 @@ class ConnectionRemover: connection = pool.pool.get() if isinstance(connection, self._connection_class): connections.remove(connection) + connection.close() else: readd_connections.append(connection) for connection in readd_connections: