(self)
| 1572 | ''') |
| 1573 | |
| 1574 | async def test_custom_codec_composite_non_tuple(self): |
| 1575 | await self.con.execute(''' |
| 1576 | CREATE TYPE mycomplex AS (r float, i float); |
| 1577 | ''') |
| 1578 | |
| 1579 | try: |
| 1580 | with self.assertRaisesRegex( |
| 1581 | asyncpg.UnsupportedClientFeatureError, |
| 1582 | "only tuple-format codecs can be used on composite types", |
| 1583 | ): |
| 1584 | await self.con.set_type_codec( |
| 1585 | 'mycomplex', |
| 1586 | encoder=lambda x: (x.real, x.imag), |
| 1587 | decoder=lambda t: complex(t[0], t[1]), |
| 1588 | ) |
| 1589 | finally: |
| 1590 | await self.con.execute(''' |
| 1591 | DROP TYPE mycomplex; |
| 1592 | ''') |
| 1593 | |
| 1594 | async def test_timetz_encoding(self): |
| 1595 | try: |
nothing calls this directly
no test coverage detected