2020from venv import EnvBuilder
2121
2222
23- def test_install (tmp_path : Path ) -> None :
23+ def test_install (tmp_path : Path , browser_name : str ) -> None :
2424 env = EnvBuilder (with_pip = True )
2525 env .create (env_dir = tmp_path )
2626 context = env .ensure_directories (tmp_path )
@@ -43,10 +43,10 @@ def test_install(tmp_path: Path) -> None:
4343 environ = os .environ .copy ()
4444 environ ["PLAYWRIGHT_BROWSERS_PATH" ] = str (tmp_path )
4545 subprocess .check_output (
46- [context .env_exe , "-m" , "playwright" , "install" ], env = environ
46+ [context .env_exe , "-m" , "playwright" , "install" , browser_name ], env = environ
4747 )
4848 shutil .copyfile (root / "tests" / "assets" / "client.py" , tmp_path / "main.py" )
49- subprocess .check_output ([ context . env_exe , str ( tmp_path / "main.py" )], env = environ )
50- assert (tmp_path / "chromium.png" ). exists ()
51- assert ( tmp_path / "firefox.png" ). exists ( )
52- assert (tmp_path / "webkit .png" ).exists ()
49+ subprocess .check_output (
50+ [ context . env_exe , str (tmp_path / "main.py" ), browser_name ], env = environ
51+ )
52+ assert (tmp_path / f" { browser_name } .png" ).exists ()
0 commit comments