(self)
| 1618 | ''') |
| 1619 | |
| 1620 | async def test_custom_codec_composite_non_tuple(self): |
| 1621 | await self.con.execute(''' |
| 1622 | CREATE TYPE mycomplex AS (r float, i float); |
| 1623 | ''') |
| 1624 | |
| 1625 | try: |
| 1626 | with self.assertRaisesRegex( |
| 1627 | asyncpg.UnsupportedClientFeatureError, |
| 1628 | "only tuple-format codecs can be used on composite types", |
| 1629 | ): |
| 1630 | await self.con.set_type_codec( |
| 1631 | 'mycomplex', |
| 1632 | encoder=lambda x: (x.real, x.imag), |
| 1633 | decoder=lambda t: complex(t[0], t[1]), |
| 1634 | ) |
| 1635 | finally: |
| 1636 | await self.con.execute(''' |
| 1637 | DROP TYPE mycomplex; |
| 1638 | ''') |
| 1639 | |
| 1640 | async def test_timetz_encoding(self): |
| 1641 | try: |
nothing calls this directly
no test coverage detected