()
| 77 | |
| 78 | @pytest.mark.asyncio |
| 79 | async def test_ssl_true(): |
| 80 | db_config, is_asyncpg, is_psycopg = _get_db_config() |
| 81 | if not is_asyncpg and not is_psycopg: |
| 82 | pytest.skip("PostgreSQL only") |
| 83 | |
| 84 | db_config["connections"]["models"]["credentials"]["ssl"] = True |
| 85 | ssl_failed = False |
| 86 | try: |
| 87 | await Tortoise.init(db_config, _create_db=True) |
| 88 | except (ConnectionError, ssl.SSLError): |
| 89 | ssl_failed = True |
| 90 | else: |
| 91 | assert False, "Expected ConnectionError or SSLError" |
| 92 | finally: |
| 93 | # Don't try to drop database if SSL connection failed - we can't connect |
| 94 | if Tortoise._inited and not ssl_failed: |
| 95 | await Tortoise._drop_databases() |
| 96 | |
| 97 | |
| 98 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected
searching dependent graphs…