(
browser: Browser,
)
| 91 | |
| 92 | @pytest.fixture |
| 93 | async def context_factory( |
| 94 | browser: Browser, |
| 95 | ) -> AsyncGenerator["Callable[..., Awaitable[BrowserContext]]", None]: |
| 96 | contexts = [] |
| 97 | |
| 98 | async def launch(**kwargs: Any) -> BrowserContext: |
| 99 | context = await browser.new_context(**kwargs) |
| 100 | contexts.append(context) |
| 101 | return context |
| 102 | |
| 103 | yield launch |
| 104 | for context in contexts: |
| 105 | await context.close() |
| 106 | |
| 107 | |
| 108 | @pytest.fixture(scope="session") |
no test coverage detected