(
self,
host: str = "127.0.0.1",
port: int | None = None,
app: Any | None = None,
implementation: BackendType[Any] | None = None,
options: Any | None = None,
timeout: float | None = None,
)
| 39 | _exit_stack = AsyncExitStack() |
| 40 | |
| 41 | def __init__( |
| 42 | self, |
| 43 | host: str = "127.0.0.1", |
| 44 | port: int | None = None, |
| 45 | app: Any | None = None, |
| 46 | implementation: BackendType[Any] | None = None, |
| 47 | options: Any | None = None, |
| 48 | timeout: float | None = None, |
| 49 | ) -> None: |
| 50 | self.host = host |
| 51 | self.port = port or find_available_port(host) |
| 52 | self.mount, self._root_component = _hotswap() |
| 53 | self.timeout = ( |
| 54 | REACTPY_TESTING_DEFAULT_TIMEOUT.current if timeout is None else timeout |
| 55 | ) |
| 56 | |
| 57 | if app is not None and implementation is None: |
| 58 | msg = "If an application instance its corresponding server implementation must be provided too." |
| 59 | raise ValueError(msg) |
| 60 | |
| 61 | self._app = app |
| 62 | self.implementation = implementation or default_server |
| 63 | self._options = options |
| 64 | |
| 65 | @property |
| 66 | def log_records(self) -> list[logging.LogRecord]: |
nothing calls this directly
no test coverage detected