(self)
| 255 | assert not hasattr(c1, "__dict__") |
| 256 | |
| 257 | def test_attribute_sanity(self): |
| 258 | assert hasattr(table1, "c") |
| 259 | assert hasattr(table1.select().subquery(), "c") |
| 260 | assert not hasattr(table1.c.myid.self_group(), "columns") |
| 261 | assert not hasattr(table1.c.myid, "columns") |
| 262 | assert not hasattr(table1.c.myid, "c") |
| 263 | assert not hasattr(table1.select().subquery().c.myid, "c") |
| 264 | assert not hasattr(table1.select().subquery().c.myid, "columns") |
| 265 | assert not hasattr(table1.alias().c.myid, "columns") |
| 266 | assert not hasattr(table1.alias().c.myid, "c") |
| 267 | with testing.expect_deprecated( |
| 268 | "The SelectBase.c and SelectBase.columns attributes are " |
| 269 | "deprecated" |
| 270 | ): |
| 271 | assert hasattr(table1.select(), "c") |
| 272 | |
| 273 | assert_raises_message( |
| 274 | exc.InvalidRequestError, |
| 275 | "Scalar Select expression has no " |
| 276 | "columns; use this object directly within a " |
| 277 | "column-level expression.", |
| 278 | getattr, |
| 279 | select(table1.c.myid).scalar_subquery().self_group(), |
| 280 | "columns", |
| 281 | ) |
| 282 | |
| 283 | assert_raises_message( |
| 284 | exc.InvalidRequestError, |
| 285 | "Scalar Select expression has no " |
| 286 | "columns; use this object directly within a " |
| 287 | "column-level expression.", |
| 288 | getattr, |
| 289 | select(table1.c.myid).scalar_subquery(), |
| 290 | "columns", |
| 291 | ) |
| 292 | |
| 293 | def test_table_select(self): |
| 294 | self.assert_compile( |
nothing calls this directly
no test coverage detected