j > d Z ddlmZ ddlmZ G d de ZdS )z2 Tests for dict duplicate keys Pyflakes behavior. )messages)TestCasec e Zd Zd Zd Zd Zd Zd Zd Zd Z d Z d Zd Zd Z d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )Testc \ | dt j t j d S )Nz{'yes': 1, 'yes': 2}flakesmMultiValueRepeatedKeyLiteralselfs i/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pyflakes/test/test_dict.pytest_duplicate_keyszTest.test_duplicate_keys 1 " * * c 0 | d d S )Nz{b'a': 1, u'a': 2}r r s r (test_duplicate_keys_bytes_vs_unicode_py3z-Test.test_duplicate_keys_bytes_vs_unicode_py3 s ()))))r c \ | dt j t j d S )Nz{1: b'a', 1: u'a'}r r s r *test_duplicate_values_bytes_vs_unicode_py3z/Test.test_duplicate_values_bytes_vs_unicode_py3 1 * * r c | dt j t j t j t j d S )Nz&{'yes': 1, 'yes': 2, 'no': 2, 'no': 3}r r s r test_multiple_duplicate_keysz!Test.test_multiple_duplicate_keys s= 4 * * * * r c \ | dt j t j d S )Nz` def f(thing): pass f({'yes': 1, 'yes': 2}) r r s r test_duplicate_keys_in_functionz$Test.test_duplicate_keys_in_function% 5 * * r c \ | dt j t j d S )Nzlambda x: {(0,1): 1, (0,1): 2}r r s r test_duplicate_keys_in_lambdaz"Test.test_duplicate_keys_in_lambda0 s1 , * * r c \ | dt j t j d S )Nz{(0,1): 1, (0,1): 2}r r s r test_duplicate_keys_tupleszTest.test_duplicate_keys_tuples7 r r c \ | dt j t j d S )Nz{(0,1): 1, (0,1.0): 2}r r s r (test_duplicate_keys_tuples_int_and_floatz-Test.test_duplicate_keys_tuples_int_and_float> s1 $ * * r c \ | dt j t j d S )Nz{1: 1, 1: 2}r r s r test_duplicate_keys_intszTest.test_duplicate_keys_intsE s1 * * r c \ | dt j t j d S )Nz{True: 1, True: 2}r r s r test_duplicate_keys_boolszTest.test_duplicate_keys_boolsL r r c \ | dt j t j d S )Nz{False: 1, False: 2}r r s r test_duplicate_keys_bools_falsez$Test.test_duplicate_keys_bools_falseS s1 " * * r c \ | dt j t j d S )Nz{None: 1, None: 2}r r s r test_duplicate_keys_nonezTest.test_duplicate_keys_none[ r r c \ | dt j t j d S )Nz8 a = 1 {a: 1, a: 2} )r r MultiValueRepeatedKeyVariabler s r test_duplicate_variable_keysz!Test.test_duplicate_variable_keysb s5 + + r c \ | dt j t j d S )NzJ a = 1 b = 2 {1: a, 1: b} r r s r test_duplicate_variable_valuesz#Test.test_duplicate_variable_valuesl r r c \ | dt j t j d S )NzJ a = 1 b = 1 {1: a, 1: b} r r s r )test_duplicate_variable_values_same_valuez.Test.test_duplicate_variable_values_same_valuew s7 * * r c \ | dt j t j dS )z These do look like different values, but when it comes to their use as keys, they compare as equal and so are actually duplicates. The literal dict {1: 1, 1.0: 1} actually becomes {1.0: 1}. z( {1: 1, 1.0: 2} Nr r s r test_duplicate_key_float_and_intz%Test.test_duplicate_key_float_and_int s7 * * r c 0 | d d S )Nz& {'yes': 1, 'yes': 1} r r s r &test_no_duplicate_key_error_same_valuez+Test.test_no_duplicate_key_error_same_value ' r c 0 | d d S )Nz% {'yes': 1, 'no': 2} r r s r test_no_duplicate_key_errorsz!Test.test_no_duplicate_key_errors r6 r c 0 | d d S )Nz{(0,1): 1, (0,2): 1}r r s r 0test_no_duplicate_keys_tuples_same_first_elementz5Test.test_no_duplicate_keys_tuples_same_first_element s *+++++r c 0 | d d S )Nz^ def test(thing): pass test({True: 1, None: 2, False: 1}) r r s r &test_no_duplicate_key_errors_func_callz+Test.test_no_duplicate_key_errors_func_call ' r c 0 | d d S )Nz{True: 1, None: 2, False: 1}r r s r )test_no_duplicate_key_errors_bool_or_nonez.Test.test_no_duplicate_key_errors_bool_or_none s 233333r c 0 | d d S )Nz {1: 1, 2: 1} r r s r !test_no_duplicate_key_errors_intsz&Test.test_no_duplicate_key_errors_ints