(self, metadata, connection, returning)
| 272 | ) |
| 273 | @testing.requires.multivalues_inserts |
| 274 | def test_seq_multivalues_inline(self, metadata, connection, returning): |
| 275 | _implicit_returning = "no_implicit_returning" not in returning |
| 276 | t1 = Table( |
| 277 | "t", |
| 278 | metadata, |
| 279 | Column( |
| 280 | "x", |
| 281 | Integer, |
| 282 | normalize_sequence(config, Sequence("my_seq")), |
| 283 | primary_key=True, |
| 284 | ), |
| 285 | Column("data", String(50)), |
| 286 | implicit_returning=_implicit_returning, |
| 287 | ) |
| 288 | |
| 289 | metadata.create_all(connection) |
| 290 | conn = connection |
| 291 | |
| 292 | stmt = t1.insert().values( |
| 293 | [{"data": "d1"}, {"data": "d2"}, {"data": "d3"}] |
| 294 | ) |
| 295 | if returning == "explicit_returning": |
| 296 | stmt = stmt.returning(t1.c.x) |
| 297 | elif "return_defaults" in returning: |
| 298 | stmt = stmt.return_defaults() |
| 299 | |
| 300 | r = conn.execute(stmt) |
| 301 | if returning == "explicit_returning": |
| 302 | eq_(r.all(), [(1,), (2,), (3,)]) |
| 303 | elif "return_defaults" in returning: |
| 304 | eq_(r.returned_defaults_rows, None) |
| 305 | |
| 306 | # TODO: not sure what this is |
| 307 | eq_(r.inserted_primary_key_rows, [(None,)]) |
| 308 | |
| 309 | eq_( |
| 310 | conn.execute(t1.select().order_by(t1.c.x)).all(), |
| 311 | [(1, "d1"), (2, "d2"), (3, "d3")], |
| 312 | ) |
| 313 | |
| 314 | @testing.combinations( |
| 315 | ("implicit_returning",), |
nothing calls this directly
no test coverage detected