(self, connection, metadata, downgrade)
| 1319 | @testing.only_on("postgresql>=13") |
| 1320 | @testing.variation("downgrade", [True, False]) |
| 1321 | def test_fixture_downgraded(self, connection, metadata, downgrade): |
| 1322 | t = Table( |
| 1323 | "t", |
| 1324 | metadata, |
| 1325 | Column( |
| 1326 | "id", |
| 1327 | Uuid(), |
| 1328 | server_default=func.gen_random_uuid(), |
| 1329 | primary_key=True, |
| 1330 | ), |
| 1331 | Column("data", String(50)), |
| 1332 | ) |
| 1333 | metadata.create_all(connection) |
| 1334 | |
| 1335 | r1 = connection.execute( |
| 1336 | insert(t).returning(t.c.data, sort_by_parameter_order=True), |
| 1337 | [{"data": "d1"}, {"data": "d2"}, {"data": "d3"}], |
| 1338 | ) |
| 1339 | eq_(r1.all(), [("d1",), ("d2",), ("d3",)]) |
| 1340 | |
| 1341 | if downgrade: |
| 1342 | insertmanyvalues_fixture(connection, warn_on_downgraded=True) |
| 1343 | |
| 1344 | with self._expect_downgrade_warnings( |
| 1345 | warn_for_downgrades=True, |
| 1346 | sort_by_parameter_order=True, |
| 1347 | ): |
| 1348 | connection.execute( |
| 1349 | insert(t).returning( |
| 1350 | t.c.data, sort_by_parameter_order=True |
| 1351 | ), |
| 1352 | [{"data": "d1"}, {"data": "d2"}, {"data": "d3"}], |
| 1353 | ) |
| 1354 | else: |
| 1355 | # run a plain test to help ensure the fixture doesn't leak to |
| 1356 | # other tests |
| 1357 | r1 = connection.execute( |
| 1358 | insert(t).returning(t.c.data, sort_by_parameter_order=True), |
| 1359 | [{"data": "d1"}, {"data": "d2"}, {"data": "d3"}], |
| 1360 | ) |
| 1361 | eq_(r1.all(), [("d1",), ("d2",), ("d3",)]) |
| 1362 | |
| 1363 | @testing.variation( |
| 1364 | "sequence_type", |
nothing calls this directly
no test coverage detected