Skip to content

Commit a2d979e

Browse files
committed
fix test and add debug values
1 parent a775210 commit a2d979e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/toolchains/defs.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
""
1616

1717
load("//python:versions.bzl", "PLATFORMS", "TOOL_VERSIONS")
18+
load("//python/private:version.bzl", "version") # buildifier: disable=bzl-visibility
1819
load("//tests/support:py_reconfig.bzl", "py_reconfig_test")
1920

2021
def define_toolchain_tests(name):
@@ -38,13 +39,15 @@ def define_toolchain_tests(name):
3839
is_platform = "_is_{}".format(platform_key)
3940
target_compatible_with[is_platform] = []
4041

42+
parsed = version.parse(python_version, strict = True)
43+
expect_python_version = "{0}.{1}.{2}".format(*parsed.release)
4144
py_reconfig_test(
4245
name = "python_{}_test".format(python_version),
4346
srcs = ["python_toolchain_test.py"],
4447
main = "python_toolchain_test.py",
4548
python_version = python_version,
4649
env = {
47-
"EXPECT_PYTHON_VERSION": python_version,
50+
"EXPECT_PYTHON_VERSION": expect_python_version,
4851
},
4952
deps = ["//python/runfiles"],
5053
data = ["//tests/support:current_build_settings"],

tests/toolchains/python_toolchain_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
import pathlib
44
import pprint
55
import sys
6+
import textwrap
67
import unittest
78

9+
print("PYTHONPATH is:")
10+
print(textwrap.indent("\n".join(sys.path), prefix=" " * 4))
811
from python.runfiles import runfiles
912

1013

0 commit comments

Comments
 (0)