MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / _resolve_bazel_path

Function _resolve_bazel_path

py/conftest.py:196–213  ·  view source on GitHub ↗

Resolve a path through Bazel Rlocation if the given path does not exist on disk. When running under Bazel, paths from ctx.expand_location are relative to the execroot (e.g. 'external/+ext+repo/binary') which may not resolve from the test process CWD. Rlocation maps them to their absolut

(path)

Source from the content-addressed store, hash-verified

194
195
196def _resolve_bazel_path(path):
197 """Resolve a path through Bazel Rlocation if the given path does not exist on disk.
198
199 When running under Bazel, paths from ctx.expand_location are relative to
200 the execroot (e.g. 'external/+ext+repo/binary') which may not resolve from
201 the test process CWD. Rlocation maps them to their absolute runfiles location.
202 """
203 if not path:
204 return path
205 cleaned = path.strip("'")
206 if Path(cleaned).exists():
207 return path
208 if Runfiles is not None and cleaned.startswith("external/"):
209 r = Runfiles.Create()
210 resolved = r.Rlocation(cleaned.removeprefix("external/"))
211 if resolved:
212 return resolved
213 return path
214
215
216# Maps the test driver name to its (browserName, vendor options key).

Callers 11

driver_finderFunction · 0.90
chromium_driverMethod · 0.90
chromium_driverMethod · 0.90
chromium_driverMethod · 0.90
chromium_driverMethod · 0.90
_pinned_grid_argsFunction · 0.85
pytest_configureFunction · 0.85
browser_pathMethod · 0.85
driver_pathMethod · 0.85
driver_executableFunction · 0.85

Calls 3

PathClass · 0.85
existsMethod · 0.80
CreateMethod · 0.45

Tested by

no test coverage detected