a
    a                     @   s\   d Z ddlZddlZddlZddlZddlmZ ddlZdd Z	dd Z
edkrXe  dS )	z
Tests for QtAwesome.
    N)
IconicFontc                  C   s$   t jtjd dd} | dks J d S )Nz) -c "import qtawesome ; qtawesome.icon()"T)shellr   )
subprocesscallsys
executable)Zoutput_number r   =lib/python3.9/site-packages/qtawesome/tests/test_qtawesome.pytest_segfault_import   s    r
   c                 C   sL   t  }t|tsJ |j }|s(J dd t| D }|rHJ dS )a"  
    Test that each font used by qtawesome has a unique name. If this test
    fails, this probably means that you need to rename the family name of
    some fonts. Please see PR #98 for more details on why it is necessary and
    on how to do this.

    Regression test for Issue #107
    c                 S   s   g | ]\}}|d kr|qS )   r   ).0fontnamecountr   r   r	   
<listcomp>(   s   z0test_unique_font_family_name.<locals>.<listcomp>N)	qtaZ	_instance
isinstancer   r   valuescollectionsCounteritems)ZqtbotresourceZ	fontnames
duplicatesr   r   r	   test_unique_font_family_name   s    	
r   __main__)__doc__r   r   r   ZpytestZqtawesome.iconic_fontr   Z	qtawesomer   r
   r   __name__mainr   r   r   r	   <module>   s   