MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / test_connect_args_validation

Method test_connect_args_validation

tests/test_connect.py:1657–1669  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1655 os.chmod(passdir, stat.S_IRWXU)
1656
1657 async def test_connect_args_validation(self):
1658 for val in {-1, 'a', True, False, 0}:
1659 with self.assertRaisesRegex(ValueError, 'greater than 0'):
1660 await asyncpg.connect(command_timeout=val)
1661
1662 cases = itertools.product(
1663 ('max_cacheable_statement_size',
1664 'max_cached_statement_lifetime', 'statement_cache_size'),
1665 (None, -1, True, False),
1666 )
1667 for arg, val in cases:
1668 with self.assertRaisesRegex(ValueError, 'greater or equal'):
1669 await asyncpg.connect(**{arg: val})
1670
1671
1672class TestConnectionCleanup(tb.TestCase):

Callers

nothing calls this directly

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected