File: //usr/local/lib/python3.10/test/__pycache__/test_venv.cpython-310.opt-1.pyc
o
�i�Z � @ s8 d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlmZm
Z
mZmZ ddlmZmZmZ ddlZddlZddlmZ zddlZW n ey_ dZY nw e�e je jkpme je jkd�Zddd�Z G d d
� d
ej!�Z"G dd� de"�Z#eG d
d� de"��Z$e%dkr�e�&� dS dS )z|
Test harness for the venv module.
Copyright (C) 2011-2012 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
� N)�captured_stdout�captured_stderr�
requires_zlib�*skip_if_broken_multiprocessing_synchronize)�can_symlink�EnvironmentVarGuard�rmtree)�patchz:cannot run venv.create from within a venv on this platformc C sB t j| t jt j|d�}|�� \}}|jrt �|j| ||��||fS )N)�stdout�stderr�encoding)�
subprocess�Popen�PIPE�communicate�
returncode�CalledProcessError)�cmdr �p�out�err� r �+/usr/local/lib/python3.10/test/test_venv.py�check_output% s �
�r c @ sB e Zd ZdZdZdd� Zdd� Zdd� Zd d
� Zdd�d
d�Z dS )�BaseTestzBase class for venv tests.i� c C s� t j�t�� �| _t jdkrd| _d| _d| _ nd| _ddt
jd d� f| _d | _ t
j}t j�
|�d
| _t
jdkrLt j�|�rLt j�|�sLd| _d S d
| _d S )N�nt�Scripts��Lib�Include�bin�lib�python%d.%d� �include����win32TF)�os�path�realpath�tempfile�mkdtemp�env_dir�name�bindirr! r$ �sys�version_info�_base_executable�split�exe�platform�lexists�exists�cannot_link_exe)�self�
executabler r r �setUp4 s"