(self)
| 1437 | eq_(f1._generate_cache_key(), None) |
| 1438 | |
| 1439 | def test_cache_key_no_method(self): |
| 1440 | class Foobar1(ClauseElement): |
| 1441 | pass |
| 1442 | |
| 1443 | class Foobar2(ColumnElement): |
| 1444 | pass |
| 1445 | |
| 1446 | # the None for cache key will prevent objects |
| 1447 | # which contain these elements from being cached. |
| 1448 | f1 = Foobar1() |
| 1449 | with expect_warnings( |
| 1450 | "Class Foobar1 will not make use of SQL compilation caching" |
| 1451 | ): |
| 1452 | eq_(f1._generate_cache_key(), None) |
| 1453 | |
| 1454 | f2 = Foobar2() |
| 1455 | with expect_warnings( |
| 1456 | "Class Foobar2 will not make use of SQL compilation caching" |
| 1457 | ): |
| 1458 | eq_(f2._generate_cache_key(), None) |
| 1459 | |
| 1460 | s1 = select(column("q"), Foobar2()) |
| 1461 | |
| 1462 | # warning is memoized, won't happen the second time |
| 1463 | eq_(s1._generate_cache_key(), None) |
| 1464 | |
| 1465 | def test_get_children_no_method(self): |
| 1466 | class Foobar1(ClauseElement): |
nothing calls this directly
no test coverage detected