관리-도구
편집 파일: test_testutils.cpython-38.pyc
U �Mg�H � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddlm Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlm"Z" ddlm#Z# ddlm$Z$ ddlm%Z% ddlm&Z& ddlm'Z' ddlm(Z( ddlm)Z) ddlm*Z* ddlm+Z+ dd lm,Z, dd!lm-Z- dd"lm.Z. dd#lm/Z/ dd$lm0Z0 dd%lm1Z1 dd&lm2Z2 dd'lm3Z3 dd(lm4Z4 G d)d*� d*e�Z5G d+d,� d,e�Z6G d-d.� d.e�Z7G d/d0� d0e�Z8G d1d2� d2e�Z9e)j:j;d3d4�G d5d6� d6e��Z<G d7d8� d8e�Z=G d9d:� d:e�Z>G d;d<� d<e�Z?dS )=z1Tests for testing utils (psutil.tests namespace).� N)�FREEBSD)�NETBSD)�POSIX)�open_binary)� open_text)� supports_ipv6)�PY3)� CI_TESTING)�COVERAGE)�HAS_NET_CONNECTIONS_UNIX)�HERE)� PYTHON_EXE)�PYTHON_EXE_ENV)�PsutilTestCase)�TestMemoryLeak)�bind_socket)�bind_unix_socket�� call_until)�chdir)�create_sockets)�fake_pytest)�filter_proc_net_connections)� get_free_port)� is_namedtuple)�mock)�process_namespace)�pytest)� reap_children)�retry)�retry_on_failure)� safe_mkdir)�safe_rmpath)�system_namespace)�tcp_socketpair)� terminate)�unix_socketpair)� wait_for_file)�wait_for_pidc @ sx e Zd Ze�d�dd� �Ze�d�dd� �Ze�d�dd� �Ze�d�dd � �Ze�d�d d� �Z e�d�dd � �Z dS )�TestRetryDecoratorz time.sleepc sF t ddd d�� fdd��}ttd��� |� dks4t�|jdksBt�d S )N� � ��retries�intervalZlogfunc s � r� � � dd q dS �Nr+ r ��pop� ��queuer2 �K/opt/hc_python/lib64/python3.8/site-packages/psutil/tests/test_testutils.py�fooI s z2TestRetryDecorator.test_retry_success.<locals>.foo� )r �list�range�AssertionError� call_count��self�sleepr6 r2 r3 r5 �test_retry_successE s z%TestRetryDecorator.test_retry_successc sT t ddd d�� fdd��}ttd��� t�t�� |� W 5 Q R X |jdksPt�d S )Nr* r+ r, c s � r� � � dd q dS r/ r0 r2 r3 r2 r5 r6 W s z2TestRetryDecorator.test_retry_failure.<locals>.foo� )r r8 r9 r �raises�ZeroDivisionErrorr; r: r<