| 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 | |
| 1672 | class TestConnectionCleanup(tb.TestCase): |