Ë
    pPêj¢  ã                   óN   — d Z ddlmZ ddlmZmZmZ dedefd„Z G d„ de«      Z	y	)
zè
A "meta test" which tests the `--update-data` feature for updating .test files.
Updating the expected output, especially when it's in the form of inline (comment) assertions,
can be brittle, which is why we're "meta-testing" here.
é    )ÚSuite)ÚPytestResultÚdedent_docstringÚrun_pytest_data_suiteÚ
data_suiteÚreturnc                 ó    — t        | dgd¬«      S )zª
    Runs a suite of data test cases through 'pytest --update-data' until either tests pass
    or until a maximum number of attempts (needed for incremental tests).
    z--update-dataé   )Ú
extra_argsÚmax_attempts)r   )r   s    úd/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypy/test/meta/test_update_data.pyÚ_run_pytest_update_datar      s   € ô
 ! ¸Ð8IÐXYÔZÐZó    c                   ó   — e Zd Zdd„Zy)ÚUpdateDataSuiteNc                 óR   — t        d«      }t        d«      }|j                  |k(  sJ ‚y )Na  
            [case testCorrect]
            s: str = 42  # E: Incompatible types in assignment (expression has type "int", variable has type "str")

            [case testWrong]
            s: str = 42  # E: wrong error

            [case testXfail-xfail]
            s: str = 42  # E: wrong error

            [case testWrongMultiline]
            s: str = 42  # E: foo                          # N: bar

            [case testMissingMultiline]
            s: str = 42;  i: int = 'foo'

            [case testExtraneous]
            s: str = 'foo'  # E: wrong error

            [case testExtraneousMultiline]
            s: str = 'foo'  # E: foo                             # E: bar

            [case testExtraneousMultilineNonError]
            s: str = 'foo'  # W: foo                             # N: bar

            [case testOutCorrect]
            s: str = 42
            [out]
            main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")

            [case testOutWrong]
            s: str = 42
            [out]
            main:1: error: foobar

            [case testOutWrongIncremental]
            s: str = 42
            [out]
            main:1: error: foobar
            [out2]
            main:1: error: foobar

            [case testWrongMultipleFiles]
            import a, b
            s: str = 42  # E: foo
            [file a.py]
            s1: str = 42  # E: bar
            [file b.py]
            s2: str = 43  # E: baz
            [builtins fixtures/list.pyi]
            aC  
        [case testCorrect]
        s: str = 42  # E: Incompatible types in assignment (expression has type "int", variable has type "str")

        [case testWrong]
        s: str = 42  # E: Incompatible types in assignment (expression has type "int", variable has type "str")

        [case testXfail-xfail]
        s: str = 42  # E: wrong error

        [case testWrongMultiline]
        s: str = 42  # E: Incompatible types in assignment (expression has type "int", variable has type "str")

        [case testMissingMultiline]
        s: str = 42;  i: int = 'foo'  # E: Incompatible types in assignment (expression has type "int", variable has type "str") \
                                      # E: Incompatible types in assignment (expression has type "str", variable has type "int")

        [case testExtraneous]
        s: str = 'foo'

        [case testExtraneousMultiline]
        s: str = 'foo'

        [case testExtraneousMultilineNonError]
        s: str = 'foo'

        [case testOutCorrect]
        s: str = 42
        [out]
        main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")

        [case testOutWrong]
        s: str = 42
        [out]
        main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")

        [case testOutWrongIncremental]
        s: str = 42
        [out]
        main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
        [out2]
        main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")

        [case testWrongMultipleFiles]
        import a, b
        s: str = 42  # E: Incompatible types in assignment (expression has type "int", variable has type "str")
        [file a.py]
        s1: str = 42  # E: Incompatible types in assignment (expression has type "int", variable has type "str")
        [file b.py]
        s2: str = 43  # E: Incompatible types in assignment (expression has type "int", variable has type "str")
        [builtins fixtures/list.pyi]
        )r   r   Úinput_updated)ÚselfÚresultÚexpecteds      r   Útest_update_dataz UpdateDataSuite.test_update_data   s<   € ô )ð 5*ó 5ˆôp $ð 3%ó 3ˆðh ×#Ñ# xÒ/Ð/Ñ/r   )r   N)Ú__name__Ú
__module__Ú__qualname__r   © r   r   r   r      s   „ ôo0r   r   N)
Ú__doc__Úmypy.test.helpersr   Úmypy.test.meta._pytestr   r   r   Ústrr   r   r   r   r   ú<module>r       s9   ðñõ $ß XÑ Xð[¨ð [°ó [ôp0�eõ p0r   