From 29b1eebc55b9e062c7beede0ec39289cb5888ed8 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Sun, 16 Aug 2026 22:14:18 +0000 Subject: [PATCH 1/2] test(runfiles): migrate runfiles tests to pytest_test Migrate runfiles py_test targets to pytest_test so they run under pytest. Update test targets in tests/runfiles/BUILD.bazel to use pytest_test from //tests/support/pytest_test:pytest_test.bzl and remove redundant main attributes. --- tests/runfiles/BUILD.bazel | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/runfiles/BUILD.bazel b/tests/runfiles/BUILD.bazel index 505b3c17c5..125a21a7fe 100644 --- a/tests/runfiles/BUILD.bazel +++ b/tests/runfiles/BUILD.bazel @@ -1,8 +1,8 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("@rules_python//python:py_test.bzl", "py_test") load("@rules_python//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility +load("//tests/support/pytest_test:pytest_test.bzl", "pytest_test") -py_test( +pytest_test( name = "runfiles_test", srcs = ["runfiles_test.py"], data = [ @@ -14,7 +14,7 @@ py_test( deps = ["//python/runfiles"], ) -py_test( +pytest_test( name = "runfiles_min_python_test", srcs = ["runfiles_test.py"], data = [ @@ -23,21 +23,19 @@ py_test( env = { "BZLMOD_ENABLED": "1" if BZLMOD_ENABLED else "0", }, - main = "runfiles_test.py", python_version = "3.10", deps = ["//python/runfiles"], ) -py_test( +pytest_test( name = "pathlib_test", srcs = ["pathlib_test.py"], deps = ["//python/runfiles"], ) -py_test( +pytest_test( name = "pathlib_min_python_test", srcs = ["pathlib_test.py"], - main = "pathlib_test.py", python_version = "3.10", deps = ["//python/runfiles"], ) From 2e3c6bee01a7b7a1ba9a4766b81b21471dedcb5c Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Sun, 16 Aug 2026 22:22:42 +0000 Subject: [PATCH 2/2] fix(runfiles): keep min python tests as py_test for workspace mode compatibility Keep runfiles_min_python_test and pathlib_min_python_test as py_test so they can test Python 3.10 in WORKSPACE mode without requiring multi-version pip dependencies. --- tests/runfiles/BUILD.bazel | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/runfiles/BUILD.bazel b/tests/runfiles/BUILD.bazel index 125a21a7fe..04d7f1aafb 100644 --- a/tests/runfiles/BUILD.bazel +++ b/tests/runfiles/BUILD.bazel @@ -1,4 +1,5 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") +load("@rules_python//python:py_test.bzl", "py_test") load("@rules_python//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility load("//tests/support/pytest_test:pytest_test.bzl", "pytest_test") @@ -14,7 +15,7 @@ pytest_test( deps = ["//python/runfiles"], ) -pytest_test( +py_test( name = "runfiles_min_python_test", srcs = ["runfiles_test.py"], data = [ @@ -23,6 +24,7 @@ pytest_test( env = { "BZLMOD_ENABLED": "1" if BZLMOD_ENABLED else "0", }, + main = "runfiles_test.py", python_version = "3.10", deps = ["//python/runfiles"], ) @@ -33,9 +35,10 @@ pytest_test( deps = ["//python/runfiles"], ) -pytest_test( +py_test( name = "pathlib_min_python_test", srcs = ["pathlib_test.py"], + main = "pathlib_test.py", python_version = "3.10", deps = ["//python/runfiles"], )