ML ivdZddlmZddlZddlZddlmZddlmZddl m Z ddl m Z m Z Gdd e Zd d Zy) zTest cases for `--output=json`. These cannot be run by the usual unit test runner because of the backslashes in the output, which get normalized to forward slashes by the test suite on Windows. ) annotationsN)api)PYTHON3_VERSION) test_temp_dir)DataDrivenTestCase DataSuiteceZdZdgZddZy)OutputJSONsuitezoutputjson.testct|y)N)test_output_json)selftestcases Z/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypy/test/testoutput.pyrun_casezOutputJSONsuite.run_cases "NrrreturnNone)__name__ __module__ __qualname__filesrrrr r s  E#rr c dg}|jddjtttt j jtd}|j|t|dd5}|jD]}|j|d d d d g}tj|\}}}||zjdjD]} | jtt j zrB|j| t#tt j zd jd k|j| jd |d kDr|jd t j$|t j j'd d} |D cgc]} | j't| zd} } | |j(k(sJy #1swYWxYwcc} w)zNRuns Mypy in a subprocess, and ensures that `--output=json` works as intended.z --output=jsonz--python-version=.mainwutf8)encoding Nz z!!! Mypy crashed !!!\z\\)appendjoinmapstrrospathropeninputwriterrunrstrip splitlines startswithseplenremovereplaceoutput) r mypy_cmdline program_pathfilesr5outerr returncodelinejson_os_separatornormalized_outputs rr r s#$L+CHHSo5N,O+PQR77<< v6L % lC& 1!T !A JJ!Bx  !!F77<0Cjs""4(335/ ??=2661 2 MM$s=266#9:<=DDVL M MM$++f- . / A~ ,-IIltV4Y_`QUm6G&GL``  // /3!!.as<&G8 H8Hr)__doc__ __future__rr(os.pathmypyr mypy.defaultsrmypy.test.configrmypy.test.datarrr r rrrrGs2 # )*8#i#!0r