o
    ¹¼tf¾  ã                   @   s2   d dl Z d dlZdd„ Zdd„ Zejdd„ ƒZdS )é    Nc                 C   s*   dt jv rt jd  ¡ t jd< ddl}dS )zConfigure the test environment.Z
USE_QT_APIZQT_APIr   N)ÚosÚenvironÚlowerÚqtpy)Úconfigr   © r   ú\/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/qtpy/tests/conftest.pyÚpytest_configure   s   
r	   c                 C   sÒ  t j}|d7 }zddlm} |d|j› d|j› 7 }W n ty(   |d7 }Y n ty4   |d7 }Y nw |t j7 }|d7 }zdd	l}dd
lm	} |d|j
› d|j
› 7 }W n tyc   |d7 }Y n tyo   |d7 }Y nw |t j7 }|d7 }zdd
lm	} |d|j› d|j› 7 }W n tyš   |d7 }Y n ty¦   |d7 }Y nw |t j7 }|d7 }zdd	l}dd
lm	} |d|j
› d|j
› 7 }W n tyÕ   |d7 }Y n tyá   |d7 }Y nw |t j7 }|S )z0Insert a customized header into the test report.zPyQt5: r   )ÚQtzPyQt: z - Qt: znot installedzunknown versionz	PySide2: N)ÚQtCorezPySide: zPyQt6: z	PySide6: )r   ÚlinesepZPyQt5r
   ZPYQT_VERSION_STRZQT_VERSION_STRÚImportErrorÚAttributeErrorÚPySide2r   Ú__version__ZPyQt6ÚPySide6)r   Úversionsr
   r   r   r   r   r   r   Úpytest_report_header   s\   ÿ
ÿ
ÿÿ
ÿ
r   c                 c   sF    ddl m} ddlm} |dƒ}| t|ƒ¡}||fV  | ¡  d S )Nr   )ÚPath)ÚQtGuiztest.pdf)Úpathlibr   r   r   Z
QPdfWriterÚstrÚunlink)Zqtbotr   r   Zoutput_pathZdevicer   r   r   Ú
pdf_writerM   s   €
r   )r   Zpytestr	   r   Zfixturer   r   r   r   r   Ú<module>   s    <