close() doesn't close a connection the session didn't open
(self)
| 149 | c.exec_driver_sql("select * from users") |
| 150 | |
| 151 | def test_close(self): |
| 152 | """close() doesn't close a connection the session didn't open""" |
| 153 | |
| 154 | User, users = self.classes.User, self.tables.users |
| 155 | |
| 156 | c = testing.db.connect() |
| 157 | c.exec_driver_sql("select * from users") |
| 158 | |
| 159 | self.mapper_registry.map_imperatively(User, users) |
| 160 | s = Session(bind=c) |
| 161 | s.add(User(name="first")) |
| 162 | s.flush() |
| 163 | c.exec_driver_sql("select * from users") |
| 164 | s.close() |
| 165 | c.exec_driver_sql("select * from users") |
| 166 | |
| 167 | def test_autobegin_execute(self): |
| 168 | # test the new autobegin behavior introduced in #5074 |
nothing calls this directly
no test coverage detected