File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,9 @@ def test_platform_things(self):
218
218
import sysconfig
219
219
import platform
220
220
import importlib .machinery
221
+ import tempfile
222
+ import venv
223
+ import subprocess
221
224
self .assertEqual (sys .implementation .name , "cpython" )
222
225
self .assertEqual (sys .platform , "win32" )
223
226
self .assertTrue (sysconfig .get_platform ().startswith ("mingw" ))
@@ -241,6 +244,21 @@ def test_platform_things(self):
241
244
self .assertEqual (platform .system (), "Windows" )
242
245
self .assertTrue (isinstance (sys .api_version , int ) and sys .api_version > 0 )
243
246
247
+ with tempfile .TemporaryDirectory () as tmp :
248
+ builder = venv .EnvBuilder ()
249
+ builder .create (tmp )
250
+ # This will not work in in-tree build
251
+ if not sysconfig .is_python_build ():
252
+ op = subprocess .check_output (
253
+ [
254
+ os .path .join (tmp , "bin" , "python.exe" ),
255
+ "-c" ,
256
+ "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
257
+ ],
258
+ cwd = tmp ,
259
+ )
260
+ self .assertTrue (op .decode ().strip ().startswith (sys .base_prefix ))
261
+
244
262
def test_sys_getpath (self ):
245
263
# everything sourced from getpath.py
246
264
import sys
You can’t perform that action at this time.
0 commit comments