bg_~ddlmZddlZddlZddlmZddlmZddlm Z ddl m Z m Z ddl mZGdd e ZdS) ) annotationsN)Config) PY38_PLUS)FunctionalTestFile)LintModuleTestMessageCounter) OutputLinecxeZdZdZGddejZejde ddfd ZddZ xZ S)LintModuleOutputUpdatezXClass to be used if expected output files should be updated instead of checked. ceZdZdZdZdZdS)"LintModuleOutputUpdate.TestDialectzDialect used by the csv writer.: N)__name__ __module__ __qualname____doc__ delimiterlineterminator/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/testutils/functional/lint_module_output_update.py TestDialectr s-- rrtestN test_filerconfig Config | NonereturnNonecxtstdt||dS)NzYou need at least python 3.8 for the functional test updater to work. This is because python 3.8 includes a new AST parser, which amongst others returns the end line and end column of most nodes.)r RuntimeErrorsuper__init__)selfrr __class__s rr#zLintModuleOutputUpdate.__init__sG E  F+++++r_rexpected_outputlist[OutputLine] actual_outputc|sK|sItj|jjrtj|jjdSt |jjdd5}tj|d}|D])}| | * ddddS#1swxYwYdS)zDOverwrite or remove the expected output file based on actual output.Nwzutf-8)encodingr)dialect) ospathexists _test_filer'removeopencsvwriterwriterowto_csv)r$r&r'r)fr5lines r_check_output_textz)LintModuleOutputUpdate._check_output_text*s } w~~do=>> ; $/9::: F $/13 I I I /QZ6222F% / / .... / / / / / / / / / / / / / / / / / / /s*AB;;B?B?)N)rrrrrr)r&rr'r(r)r(rr) rrrrr4excelrregister_dialectr#r: __classcell__)r%s@rr r sci C---FJ , , , , , , ,////////rr ) __future__rr4r._pytest.configrpylint.constantsr%pylint.testutils.functional.test_filer!pylint.testutils.lint_module_testrrpylint.testutils.output_liner r rrrrDs #""""" !!!!!!&&&&&&DDDDDDLLLLLLLL333333(/(/(/(/(/^(/(/(/(/(/r