浏览代码

Speed up pytest with eager page loads

Zed 2 月之前
父节点
当前提交
5100290f76
共有 3 个文件被更改,包括 6 次插入2 次删除
  1. 4 0
      tests/conftest.py
  2. 1 1
      tests/pyproject.toml
  3. 1 1
      tests/test_security.py

+ 4 - 0
tests/conftest.py

@@ -0,0 +1,4 @@
+from seleniumbase.config import settings
+
+settings.SKIP_JS_WAITS = True
+settings.WAIT_FOR_RSC_ON_PAGE_LOADS = False

+ 1 - 1
tests/pyproject.toml

@@ -8,4 +8,4 @@ python = "^3.14"
 seleniumbase = "4.46.5"
 
 [tool.pytest.ini_options]
-addopts = "--timeout_multiplier=3"
+addopts = "--pls=eager --reruns=3 --timeout_multiplier=3"

+ 1 - 1
tests/test_security.py

@@ -8,7 +8,7 @@ def curl_status(url):
     """Get HTTP status code using curl to avoid URL normalization by Python libs."""
     result = subprocess.run(
         ['curl', '-s', '-o', '/dev/null', '-w', '%{http_code}', url],
-        capture_output=True, text=True, timeout=10
+        capture_output=True, text=True, timeout=30
     )
     return int(result.stdout)