1515# Determine some file system anchor points for the tests
1616# Assumes that the tests are run in a virtual environment named
1717# `cross-venv`,
18- VENV_PREFIX = Path (__file__ ).parent .parent / "cross-venv"
19- default_support_base = f"support/{ sys .version_info .major } .{ sys .version_info .minor } /{ PYTHON_CROSS_PLATFORM } "
18+ VENV_PREFIX = os .getenv ("VIRTUAL_ENV" , Path (__file__ ).parent .parent / "cross-venv" )
19+ default_support_base = (
20+ f"support/{ sys .version_info .major } .{ sys .version_info .minor } /{ PYTHON_CROSS_PLATFORM } "
21+ )
2022SUPPORT_PREFIX = (
2123 Path (__file__ ).parent .parent
2224 / os .getenv ("PYTHON_SUPPORT_BASE" , default_support_base )
2931# sys
3032###########################################################################
3133
34+
3235def test_sys_platform ():
3336 assert sys .platform == PYTHON_CROSS_PLATFORM .lower ()
3437
@@ -53,6 +56,7 @@ def test_sys_base_exec_prefix():
5356# platform
5457###########################################################################
5558
59+
5660def test_platform_system ():
5761 assert platform .system () == PYTHON_CROSS_PLATFORM
5862
@@ -61,6 +65,7 @@ def test_platform_system():
6165# sysconfig
6266###########################################################################
6367
68+
6469def test_sysconfig_get_platform ():
6570 parts = sysconfig .get_platform ().split ("-" , 2 )
6671 assert parts [0 ] == PYTHON_CROSS_PLATFORM .lower ()
@@ -87,7 +92,7 @@ def test_sysconfig_get_sysconfigdata_name():
8792 ("platlib" , VENV_PREFIX ),
8893 ("scripts" , VENV_PREFIX ),
8994 ("data" , VENV_PREFIX ),
90- ]
95+ ],
9196)
9297def test_sysconfig_get_paths (name , prefix ):
9398 assert sysconfig .get_paths ()[name ].startswith (str (prefix ))
0 commit comments