
    <e                     j    d dl Z d dlZ G d dej                  Zedk    r ej                     dS dS )    Nc                   P    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd ZdS )Test_iskeywordc                 T    |                      t          j        d                     d S )NTrue)
assertTruekeyword	iskeywordselfs    (/usr/lib/python3.11/test/test_keyword.pytest_true_is_a_keywordz%Test_iskeyword.test_true_is_a_keyword   s%    )&1122222    c                 T    |                      t          j        d                     d S )NTRUEassertFalser   r	   r
   s    r   $test_uppercase_true_is_not_a_keywordz3Test_iskeyword.test_uppercase_true_is_not_a_keyword	   s'    *62233333r   c                 T    |                      t          j        d                      d S Nr   r
   s    r    test_none_value_is_not_a_keywordz/Test_iskeyword.test_none_value_is_not_a_keyword   s'    *40011111r   c                     t           j        }|                     t          t           d|           g dt           _        |                     t          j        d                     d S )Nkwlist)itsalleggsbeansandaslicer   )r   r   
addCleanupsetattrr   r	   r   oldlists     r   2test_changing_the_kwlist_does_not_affect_iskeywordzATest_iskeyword.test_changing_the_kwlist_does_not_affect_iskeyword   sS    .(G<<<MMM*62233333r   c                     t           j        }|                     t          t           d|           g dt           _        |                     t          j        d                     d S )N
softkwlist)foobarspamegscaser)   )r   r&   r    r!   r   issoftkeywordr"   s     r   :test_changing_the_softkwlist_does_not_affect_issoftkeywordzITest_iskeyword.test_changing_the_softkwlist_does_not_affect_issoftkeyword   sU    $,@@@BBB.v6677777r   c                     t           j        D ]F}|                     t                    5  t	          | d           d d d            n# 1 swxY w Y   Gd S Nz = 42)r   r   assertRaisesSyntaxErrorexecr   keys     r   *test_all_keywords_fail_to_be_used_as_namesz9Test_iskeyword.test_all_keywords_fail_to_be_used_as_names   s    > 	$ 	$C"";// $ $]]]###$ $ $ $ $ $ $ $ $ $ $ $ $ $ $	$ 	$s   AA	A	c                 H    t           j        D ]}t          | d           d S r/   )r   r&   r2   r3   s     r   +test_all_soft_keywords_can_be_used_as_namesz:Test_iskeyword.test_all_soft_keywords_can_be_used_as_names"   s5    % 	  	 CC	  	 r   c                     |                      dt          j                   |                      dt          j                   d S )Nasyncawait)assertInr   r   r
   s    r   !test_async_and_await_are_keywordsz0Test_iskeyword.test_async_and_await_are_keywords&   s4    gw~...gw~.....r   c                     |                      dt          j                   |                      dt          j                   |                      dt          j                   d S )Nmatchr+   _)r;   r   r&   r
   s    r   %test_match_and_case_are_soft_keywordsz4Test_iskeyword.test_match_and_case_are_soft_keywords*   sM    gw1222fg0111c7-.....r   c                 t    |                      t          t          j                  t          j                   d S r   )assertListEqualsortedr   r   r
   s    r   test_keywords_are_sortedz'Test_iskeyword.test_keywords_are_sorted/   s*    VGN33W^DDDDDr   c                 t    |                      t          t          j                  t          j                   d S r   )rB   rC   r   r&   r
   s    r   test_softkeywords_are_sortedz+Test_iskeyword.test_softkeywords_are_sorted2   s,    VG$6779KLLLLLr   N)__name__
__module____qualname__r   r   r   r$   r-   r5   r7   r<   r@   rD   rF    r   r   r   r      s        3 3 34 4 42 2 2
4 4 48 8 8$ $ $
     / / // / /
E E EM M M M Mr   r   __main__)r   unittestTestCaser   rG   mainrJ   r   r   <module>rO      ss     .M .M .M .M .MX& .M .M .Mb zHMOOOOO r   