|
14 | 14 | from reactpy.types import Connection, Location |
15 | 15 |
|
16 | 16 |
|
17 | | -@pytest.fixture() |
18 | | -async def display(page): |
19 | | - async with BackendFixture() as server: |
20 | | - async with DisplayFixture(backend=server, driver=page) as display: |
21 | | - yield display |
22 | | - |
23 | | - |
24 | 17 | async def test_display_simple_hello_world(display: DisplayFixture): |
25 | 18 | @reactpy.component |
26 | 19 | def Hello(): |
@@ -153,17 +146,15 @@ def sample(): |
153 | 146 | app = ReactPy(sample) |
154 | 147 |
|
155 | 148 | async with BackendFixture(app) as server: |
156 | | - async with DisplayFixture(backend=server, driver=page) as new_display: |
157 | | - await new_display.show(sample) |
158 | | - url = f"http://{server.host}:{server.port}" |
159 | | - response = await asyncio.to_thread( |
160 | | - request, "HEAD", url, timeout=REACTPY_TESTS_DEFAULT_TIMEOUT.current |
161 | | - ) |
162 | | - assert response.status_code == 200 |
163 | | - assert response.headers["content-type"] == "text/html; charset=utf-8" |
164 | | - assert response.headers["cache-control"] == "max-age=60, public" |
165 | | - assert response.headers["access-control-allow-origin"] == "*" |
166 | | - assert response.content == b"" |
| 149 | + url = f"http://{server.host}:{server.port}" |
| 150 | + response = await asyncio.to_thread( |
| 151 | + request, "HEAD", url, timeout=REACTPY_TESTS_DEFAULT_TIMEOUT.current |
| 152 | + ) |
| 153 | + assert response.status_code == 200 |
| 154 | + assert response.headers["content-type"] == "text/html; charset=utf-8" |
| 155 | + assert response.headers["cache-control"] == "max-age=60, public" |
| 156 | + assert response.headers["access-control-allow-origin"] == "*" |
| 157 | + assert response.content == b"" |
167 | 158 |
|
168 | 159 |
|
169 | 160 | async def test_custom_http_app(): |
|
0 commit comments