(self)
| 93 | @sqlite_only |
| 94 | class TestConnectionPoolWarning(TestCase): |
| 95 | async def _create_pool(self): |
| 96 | sqlite_file = os.path.join(tempfile.gettempdir(), "engine.sqlite") |
| 97 | engine = SQLiteEngine(path=sqlite_file) |
| 98 | |
| 99 | with patch("piccolo.engine.base.colored_warning") as colored_warning: |
| 100 | await engine.start_connection_pool() |
| 101 | await engine.close_connection_pool() |
| 102 | |
| 103 | self.assertEqual( |
| 104 | colored_warning.call_args_list, |
| 105 | [ |
| 106 | call( |
| 107 | "Connection pooling is not supported for sqlite.", |
| 108 | stacklevel=3, |
| 109 | ), |
| 110 | call( |
| 111 | "Connection pooling is not supported for sqlite.", |
| 112 | stacklevel=3, |
| 113 | ), |
| 114 | ], |
| 115 | ) |
| 116 | |
| 117 | def test_warnings(self): |
| 118 | """ |
no test coverage detected