Skip to content

Commit e31bee0

Browse files
committed
Rename tests
1 parent 6e502b7 commit e31bee0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
File renamed without changes.

tests/tests_asyncio/test_remote.py renamed to tests/tests_asyncio/test_browser.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,29 @@ async def _run_chromium_devtools() -> Tuple[subprocess.Popen, str]:
4242
return proc, devtools_url
4343

4444

45-
def _run_playwright_browser_server() -> Tuple[subprocess.Popen, str]:
45+
def _run_chromium_browser_server() -> Tuple[subprocess.Popen, str]:
4646
"""Start a Playwright server in a separate process, return the process
4747
object and a string with its websocket endpoint.
4848
Pass fixed port and ws path as arguments instead of allowing Playwright
4949
to choose, for some reason I was unable to capture stdout/stderr :shrug:
5050
"""
5151
port = str(random.randint(60_000, 63_000))
5252
ws_path = str(uuid.uuid4())
53-
launch_server_script_path = str(Path(__file__).parent.parent / "launch_browser_server.js")
53+
launch_server_script_path = str(Path(__file__).parent.parent / "launch_chromium_server.js")
5454
command = ["node", launch_server_script_path, port, ws_path]
5555
proc = subprocess.Popen(command) # pylint: disable=consider-using-with
5656
return proc, f"ws://localhost:{port}/{ws_path}"
5757

5858

5959
@asynccontextmanager
60-
async def remote_browser(is_chrome_devtools_protocol: bool = True):
60+
async def remote_chromium(with_devtools_protocol: bool = True):
6161
"""Launch a remote browser that lasts while in the context."""
6262
proc = url = None
6363
try:
64-
if is_chrome_devtools_protocol:
64+
if with_devtools_protocol:
6565
proc, url = await _run_chromium_devtools()
6666
else:
67-
proc, url = _run_playwright_browser_server()
67+
proc, url = _run_chromium_browser_server()
6868
await asyncio.sleep(1) # allow some time for the browser to start
6969
except Exception:
7070
pass
@@ -77,15 +77,15 @@ async def remote_browser(is_chrome_devtools_protocol: bool = True):
7777
proc.communicate()
7878

7979

80-
class TestRemote(IsolatedAsyncioTestCase):
80+
class TestRemoteBrowser(IsolatedAsyncioTestCase):
8181
@pytest.fixture(autouse=True)
8282
def inject_fixtures(self, caplog):
8383
caplog.set_level(logging.DEBUG)
8484
self._caplog = caplog
8585

8686
@allow_windows
8787
async def test_connect_devtools(self):
88-
async with remote_browser(is_chrome_devtools_protocol=True) as devtools_url:
88+
async with remote_chromium(with_devtools_protocol=True) as devtools_url:
8989
settings_dict = {
9090
"PLAYWRIGHT_CDP_URL": devtools_url,
9191
"PLAYWRIGHT_LAUNCH_OPTIONS": {"headless": True},
@@ -103,7 +103,7 @@ async def test_connect_devtools(self):
103103

104104
@allow_windows
105105
async def test_connect(self):
106-
async with remote_browser(is_chrome_devtools_protocol=False) as browser_url:
106+
async with remote_chromium(with_devtools_protocol=False) as browser_url:
107107
settings_dict = {
108108
"PLAYWRIGHT_CONNECT_URL": browser_url,
109109
"PLAYWRIGHT_LAUNCH_OPTIONS": {"headless": True},

0 commit comments

Comments
 (0)