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

Method test_connect_args_validation

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

Source from the content-addressed store, hash-verified

1644 os.chmod(passdir, stat.S_IRWXU)
1645
1646 async def test_connect_args_validation(self):
1647 for val in {-1, 'a', True, False, 0}:
1648 with self.assertRaisesRegex(ValueError, 'greater than 0'):
1649 await asyncpg.connect(command_timeout=val)
1650
1651 for arg in {'max_cacheable_statement_size',
1652 'max_cached_statement_lifetime',
1653 'statement_cache_size'}:
1654 for val in {None, -1, True, False}:
1655 with self.assertRaisesRegex(ValueError, 'greater or equal'):
1656 await asyncpg.connect(**{arg: val})
1657
1658
1659class TestConnection(tb.ConnectedTestCase):

Callers

nothing calls this directly

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected