I can only assume that the only possible thing to close on a session are the
adapters. As such, I wrote the close method for a session object which closes
all possible adapters.
return adapter
# Nothing matches :-/
- raise InvalidSchema('No connection adapters were found for \'%s\'' % url)
+ raise InvalidSchema("No connection adapters were found for '%s'" % url)
+
+ def close(self):
+ """Closes all adapters and as such the session"""
+ for _, v in self.adapters.items():
+ v.close()
def mount(self, prefix, adapter):
"""Registers a connection adapter to a prefix."""